SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Addict Bravogolf's Avatar
    Join Date
    Aug 2004
    Location
    All over really :)
    Posts
    205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Argh! Simple CSS fix needed (menu not adhering to class)

    Hi all. I’m in the process of transferring content to a new design we’ve created and am encountering niggling CSS issues along the way. One of which is a standard menu I’ve created using UL’s doesn’t appear to adhere to the CSS classes I’ve created for it. I’m pretty sure it’s something really minor but a fresh pair of eyes would be appreciated.

    I’ve created the example menu at http://www.oneclearvision.org/v2/menuexample.php (bear in mind some links are live but all are suitable for work). The CSS file is at http://www.oneclearvision.org/v2/inc...tyles/main.css, the classes for the menu are at line 70 onwards.

    Much appreciated

  2. #2
    Function Curry'er JimmyP's Avatar
    Join Date
    Aug 2007
    Location
    Brighton, UK
    Posts
    2,006
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You've commented out the rules.

    At line 70 in the CSS file change this:

    Code:
    /***left column elements**
    to this:

    Code:
    /***left column elements**/
    James Padolsey
    末末末末末末末末末末末末末末末末末末末
    Awesome JavaScript Zoomer (demo here)
    'Ajaxy' - Ajax integration solution (demo here)

  3. #3
    SitePoint Addict Bravogolf's Avatar
    Join Date
    Aug 2004
    Location
    All over really :)
    Posts
    205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ROFL! Sweet Jeebus, I didn't expect it to be that simple! Still, just shows what a second opinion does. Thanks for the prompt response

  4. #4
    SitePoint Addict Bravogolf's Avatar
    Join Date
    Aug 2004
    Location
    All over really :)
    Posts
    205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    *Edit: Ignore me, I'm asking silly questions *

  5. #5
    SitePoint Addict Bravogolf's Avatar
    Join Date
    Aug 2004
    Location
    All over really :)
    Posts
    205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Inconsistency in IE versus Opera

    Hey all, now that the menu is almost working as designed, a particular style works fine in IE but not in Opera, anyone any idea what's going on?

    Example of working as designed in Opera

    Example of working as designed in IE

    CSS is at http://www.oneclearvision.org/v2/inc...tyles/main.css

  6. #6
    Function Curry'er JimmyP's Avatar
    Join Date
    Aug 2007
    Location
    Brighton, UK
    Posts
    2,006
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Bravogolf, I am not totally sure why you have coded it that way. You have multiple (and what look like unnecessary) ULs and LIs.

    You don't have to obviously, but if you start again with a clean and cross-browser compatible basis then it will be easier to build upon.

    Anyway I had a go: (Hope you don't mind)

    Code CSS:
    #leftnav {
        float:left;
        list-style-type:none;
        display:block;
        border:1px solid black;
        padding: 0;
        margin: 0;
    }
    #leftnav li {
        display: block;
        margin: 2px 0 0 0;
        clear: left;
        padding: 0;
    }
    #leftnav a:link, #leftnav a {
        color:#333;
        text-decoration:none;
        text-align: left;
        display: block;
        clear: left;
        padding: 4px 3px;
        background: #CCCCCC;
        width: 140px;
    }
    #leftnav a:visited {
        color:#333;
    }
    #leftnav a:hover {
        color:#FFFFFF;
        text-decoration: underline;
        background: #666666;
    }

    With this markup:

    Code HTML4Strict:
    <ul id="leftnav">
        <li><a href="#">link</a></li>
        <li><a href="#">link</a></li>
        <li><a href="#">link</a></li>
        <li><a href="#">link</a></li>
        <li><a href="#">link</a></li>
        <li><a href="#">link</a></li>
    </ul>




    James Padolsey
    末末末末末末末末末末末末末末末末末末末
    Awesome JavaScript Zoomer (demo here)
    'Ajaxy' - Ajax integration solution (demo here)

  7. #7
    SitePoint Addict Bravogolf's Avatar
    Join Date
    Aug 2004
    Location
    All over really :)
    Posts
    205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah, I suspect I over complicated the CSS Yours looks good though, works fine on both browsers too so will recreate the menu and start from yours, thanks again for your help


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
  •