PDA

View Full Version : Try To color this.



sunny
06-05-2005, 05:59 PM
Hi,
I wanted to color the 'title' of the image using css.But wasn't successful.
The code:


<style>
body{
title{color:red;background:black}
}
</style>

And html code:


<IMG SRC="xyz.jpg" title="my pic">

I know that DD has got a script for this at:
http://www.dynamicdrive.com/dynamicindex4/imagetooltip.htm
But i would like to do it with the help of css, if it's possible.
Secondly,
If it's not possible, then whether use of '.title' i.e. a class name would do .then the code would go like this:


<style>
body{
.title{color:red;background:black}
}
</style>

And html code:


<IMG SRC="xyz.jpg" title="my pic" class="title">

Do also tell me whether i can use two classes or i.d's within one tag.
In this case, one class for image and another for title.

jscheuer1
06-05-2005, 06:18 PM
I don't think you can do that, I think those colors are browser and operating system specific.

mwinter
06-06-2005, 07:01 PM
I don't think you can do thatYou're correct: it's not possible.

Mike

sunny
06-06-2005, 09:52 PM
You're correct: it's not possible.

Ok,But what about my second Question:
whether i can use two classes or i.d's within one tag(both representing different things.)
Thanks & bye

mwinter
06-06-2005, 10:20 PM
Ok,But what about my second Question:
whether i can use two classes or i.d's within one tag(both representing different things.)The id attribute is an identifier: only one can appear per element, and its value must be unique within the entire document.

The class attribute can contain multiple, space-separated values:


<p class="note warning">...</p>Here, the paragraph will exhibit presentational behaviour of both the 'note' and 'warning' classes.

Be aware that in early user agents (NN4 and IE4, primarily), using two or more class names will confuse the rendering engine, making it ignore both classes.

Mike