SitePoint Sponsor

User Tag List

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

    on a:link and its effects on <a href><img></a>

    this is the code on my page:
    <style type="text/css">
    <!--
    a { text-decoration: none}
    a:link { border-bottom: dotted 1px #FFFFFF; color: #000000; }
    a:visited { border-bottom: dotted 1px #FFFFFF; color: #000000; }
    a:active { border-bottom: solid 1px #FFFFFF; color: #FFFFFF; }
    a:hover { border-bottom: solid 1px #FFFFFF; color: #FFFFFF; }
    -->
    </style>

    but i don't want to code to affect images with links. <a href><img></a> any ideas?

  2. #2
    SitePoint Evangelist
    Join Date
    Jan 2002
    Posts
    420
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, give the links with the image a separate class like
    Code:
    <a href class="image"><img></a>
    then in the CSS write
    Code:
    a.image {
    border: none;
    }
    Only way I can think of doing it right now, there might be other ways.
    Wavelan

  3. #3
    (****** or Deleted)
    Join Date
    May 2002
    Location
    Melbourne, Australia
    Posts
    299
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try this:

    Code:
    a.links {
      text-decoration:none;
      }
    
    a.links:visited {
      border-bottom:dotted 1px #fff;
      color:#000000;
      }
    
    a.links:active {
      border-bottom:solid 1px #fff;
      color:#fff;
      }
    
    a.links:hover {
      border-bottom:solid 1px #fff;
      color:#fff;
      }
    This means that all links using the class "links" will be effected.

    Now for your link code, use:

    Code:
    <a class="links" href="www.website.com">Link</a>
    Try that, should work perfectly

    If you wanted to have different css properties for the img links, you could simply set a different class for them

    Edit: Beat me to it
    Last edited by Wizardx8; Aug 29, 2002 at 19:52.


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
  •