SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2006
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    a:hover {border-bottom: 2px solid;} working on some links, but not others

    Hello

    I have used
    Code:
    a:hover {border-bottom: 2px solid;}
    to create a thick underline when the user hovers over a link which works fine in firefox but in IE it only works on some links. The links that are not working involve the following code:

    Code:
    <div id="menutop"><table width="100%" border="0" cellpadding="0" cellspacing="1"><tr><td nowrap="nowrap"><a href="http://www.brutonsolutions.co.uk/pages/index.php?option=com_frontpage&amp;Itemid=1" class="mainlevel" id="active_menu">HOME</a><span class="mainlevel"> | </span><a href="http://www.brutonsolutions.co.uk/pages/index.php?option=com_content&amp;task=view&amp;id=13&amp;Itemid=26" class="mainlevel" >ABOUT US</a><span class="mainlevel"> | </span><a href="http://www.brutonsolutions.co.uk/pages/index.php?option=com_content&amp;task=view&amp;id=14&amp;Itemid=27" class="mainlevel" >OUR WEBSITES</a><span class="mainlevel"> | </span><a href="http://www.brutonsolutions.co.uk/pages/index.php?option=com_content&amp;task=view&amp;id=15&amp;Itemid=28" class="mainlevel" >TEMPLATE WEBSITES</a><span class="mainlevel"> | </span><a href="http://www.brutonsolutions.co.uk/pages/index.php?option=com_content&amp;task=view&amp;id=16&amp;Itemid=29" class="mainlevel" >COME &amp; MEET US</a><span class="mainlevel"> | </span><a href="http://www.brutonsolutions.co.uk/pages/index.php?option=com_content&amp;task=view&amp;id=17&amp;Itemid=30" class="mainlevel" >STATISTICS</a><span class="mainlevel"> | </span><a href="http://www.brutonsolutions.co.uk/pages/index.php?option=com_content&amp;task=category&amp;sectionid=10&amp;id=19&amp;Itemid=31" class="mainlevel" >NEWS</a><span class="mainlevel"> | </span><a href="http://www.brutonsolutions.co.uk/pages/index.php?option=com_content&amp;task=view&amp;id=21&amp;Itemid=32" class="mainlevel" >CONTACT</a><span class="mainlevel"> | </span><a href="http://www.brutonsolutions.co.uk/pages/index.php?option=com_content&amp;task=view&amp;id=22&amp;Itemid=33" class="mainlevel" >LINKS</a></td></tr></table></div>
    The code is produced by a CMS but i don't see why these links are not being recognised by IE as requiring an underline. Do i need to change my CSS code so that IE will underline ALL links?

    Many thanks for any help you can give - Gaz

  2. #2
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    Increase the table cellpadding and cellspacing, or on the CSS try increase the line-height.

  3. #3
    SitePoint Enthusiast
    Join Date
    Jun 2006
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cheers mate - line-height works well (tried it earlier but needed to play with it a bit to get it to work).

    Just for anyone who reads this post in the future, the following is my code for the css:

    Code:
    a, a:link, a:visited {font-family: Myriad Web, Verdana, sans-serif; font-weight: bold; color: #000; text-decoration: none; line-height: 20px;}
    a:hover {border-bottom: 2px solid; line-height: 20px;}
    Make sure you put line-height on the hover and normal link codes - otherwise the page jumps around all over the place!

  4. #4
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    No problem.

  5. #5
    SitePoint Zealot
    Join Date
    Sep 2006
    Posts
    145
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry, I'm wondering why you're using border-bottom to create an underline and not just

    text-decoration: underline;


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
  •