Results 1 to 5 of 5

Thread: Try To color this.

  1. #1
    Join Date
    Mar 2005
    Location
    Mumbai,INDIA
    Posts
    64
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post Try To color this.

    Hi,
    I wanted to color the 'title' of the image using css.But wasn't successful.
    The code:
    Code:
    <style>
    body{
    title{color:red;background:black}
    }
    </style>
    And html code:
    Code:
    <IMG SRC="xyz.jpg" title="my pic">
    I know that DD has got a script for this at:
    http://www.dynamicdrive.com/dynamici...agetooltip.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:
    Code:
    <style>
    body{
    .title{color:red;background:black}
    }
    </style>
    And html code:
    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.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I don't think you can do that, I think those colors are browser and operating system specific.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by jscheuer1
    I don't think you can do that
    You're correct: it's not possible.

    Mike

  4. #4
    Join Date
    Mar 2005
    Location
    Mumbai,INDIA
    Posts
    64
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by mwinter
    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
    Last edited by sunny; 06-06-2005 at 08:54 PM.

  5. #5
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by sunny
    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:

    HTML Code:
    <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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •