SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Mar 2002
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    img tag inheriting a tag properties?

    Hey, I was wondering how to alter the borders of images that are inside links?
    It seems as tho, if you have a link: <a href="somewhere"><img src="anImage"></a>
    the img tag doesnt inherit the the properties of the a tag. How do I make the img tags inside the a tags inherit the a properties?
    In this case i want the imgs links to have the same border as the color of the links. e.g. links text color is red i want image link borders to also be red instead of defaulting to blue


    thanks,
    j-biz

  2. #2
    SitePoint Wizard Ian Glass's Avatar
    Join Date
    Oct 2001
    Location
    Beyond yonder
    Posts
    2,384
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try:
    Code:
    a img {
      border-color: red;
    }
    And that should do it! It's a contextual selector so it only will affect all <img>s in anchors. You can do a whole lot with the various CSS selectors that are available. So it's a good idea to learn them and which browsers support them.

    ~~Hope This Helps

  3. #3
    SitePoint Member
    Join Date
    Mar 2002
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I did,
    thanks

  4. #4
    SitePoint Wizard Ian Glass's Avatar
    Join Date
    Oct 2001
    Location
    Beyond yonder
    Posts
    2,384
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Terrific! Then you're ahead of the crowd. :-)

    So did it work for you?

    ~~Ian
    Last edited by Ian Glass; Mar 5, 2002 at 13:40.

  5. #5
    SitePoint Member
    Join Date
    Mar 2002
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    oops, yeah, it did,
    thanks again


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
  •