SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2007
    Location
    Ohio
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Current Style not working in IE

    I am having a problem with a Wordpress website I'm creating. For some reason, IE 6 & 7 isn't showing the "current" style for one of my menus.

    fam ily supp ort.org.uk/contact-us/

    The link for Contact Us should be underlined while you're on the page. On my computer in IE 6 and 7, I only see a little bit of the underline to the right of the word.

    Since this is a dynamic menu in Wordpress, I had to use this (Method One). Therefore, the styles are embedded and look like this:

    <style type="text/css">
    #<?php echo $current; ?> {
    color: #fff;
    text-decoration: underline;
    }
    </style>

    I don't understand why IE is doing this. Can someone help me and explain why it's happening?
    Susan
    Auxano Creative (formerly The WebDesign Loft)

  2. #2
    SitePoint Wizard bronze trophy Centauri's Avatar
    Join Date
    May 2007
    Location
    Newcastle, Australia
    Posts
    3,718
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    #three is the <li>, you need to target #three a

  3. #3
    SitePoint Enthusiast
    Join Date
    Jun 2007
    Location
    Ohio
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your reply. It still isn't working. I find it interesting that it works just fine in FF and Opera. And that in IE, it shows a little bit of the underline to the right, but it just won't go all the way across.

    And to clarify, this is what I have in the head of the document.

    Code:
    <?php
          if ( is_page('About Us') ) { $current = 'one'; }
          elseif ( is_page('Work For Us') ) { $current = 'two'; }
          elseif ( is_page('Contact Us') ) { $current = 'three'; }
          elseif ( is_page('Professionals') ) { $current = 'four'; }
          elseif ( is_page('Links') ) { $current = 'five'; }
        ?>
        
        <style type="text/css">
        #<?php echo $current; ?> {
        color: #fff;
        text-decoration: underline;
        }
        </style>
    And here's the menu itself.

    Code:
    <ul id="subnav">
    <li id="one"><a href="http://familysupport.org.uk/about-us/">About Us</a></li>
    <li id="two"><a href="http://familysupport.org.uk/work-for-us/">Work For Us</a></li>
    <li id="three"><a href="http://familysupport.org.uk/contact-us/">Contact Us</a></li>
    <li id="four"><a href="http://familysupport.org.uk/professionals/">Professionals</a></li>
    <li id="five"><a href="http://familysupport.org.uk/links/">Links</a></li>
    </ul>
    Susan
    Auxano Creative (formerly The WebDesign Loft)

  4. #4
    SitePoint Wizard bronze trophy Centauri's Avatar
    Join Date
    May 2007
    Location
    Newcastle, Australia
    Posts
    3,718
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A question of specificacy - try :
    Code:
    #subnav #<?php echo $current; ?> a {
        color: #fff;
        text-decoration: underline;
        }

  5. #5
    SitePoint Enthusiast
    Join Date
    Jun 2007
    Location
    Ohio
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That did it! I should have known better. Thank you sooo much!
    Susan
    Auxano Creative (formerly The WebDesign Loft)


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
  •