Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to set the 'src' on an image tag, using a CSS style class?

0 views
Skip to first unread message

Kevin Buchan

unread,
Feb 17, 2003, 3:29:24 PM2/17/03
to
I tried adding a class like the following to my CSS, but the image
always comes up blank.

.TopicPic
{
src: url(http://localhost/images/topicpic.gif);
}

------------------------
Image tag:

<img class='TpoicPic'>


---------------------------------

I have read enough to determine that the 'src' part of my CSS class is
really supposed to support font information, but I can't find squat
that lets me have a different picture in the image tag, based on the
CSS referenced.

Thanks!

-Kevin Buchan

Cybarber

unread,
Feb 20, 2003, 12:38:37 PM2/20/03
to
src is not a style elment and can't be set by CSS only by script.
read the specs!!

Cybarber

"Kevin Buchan" <kevin....@troutmansanders.com> schreef in bericht
news:4gh25vc2kantitis9...@4ax.com...

PeterMcC

unread,
Feb 20, 2003, 1:15:19 PM2/20/03
to
Kevin Buchan wrote:
> I tried adding a class like the following to my CSS, but the image
> always comes up blank.
>
> .TopicPic
> {
> src: url(http://localhost/images/topicpic.gif);
> }
>
> ------------------------
> Image tag:
>
> <img class='TpoicPic'>

AFAIK it won't work.
You could try a kludge with background-image in either a div or a cell.

--
PeterMcC
If you feel that any of the above is incorrect,
inappropriate or offensive in any way,
please ignore it and accept my apologies.

0 new messages