Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jan 2010
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    linking file to css file not working?

    I am trying to link the html file to the css file

    The code below is in a file called menu.css

    /*----------------------------------- */
    /*---------- Menu ------------ */
    /*----------------------------------- */

    #tabsI {
    float:left;
    width:100%;
    background: inherit;
    font-size:93%;
    line-height:normal;
    border-bottom:1px solid #DD740B;
    }
    #tabsI ul {
    margin:0;
    padding:10px 10px 0 50px;
    list-style:none;
    }
    #tabsI li {
    display:inline;
    margin:0;
    padding:0;
    }
    #tabsI a {
    float:left;
    background:url("images/tableftI.gif") no-repeat left top;
    margin:0;
    padding:0 0 0 5px;
    text-decoration:none;
    }

    #tabsI a span {
    float:left;
    display:block;
    background:url("images/tabrightI.gif") no-repeat right top;
    padding:5px 15px 4px 6px;
    color:#FFF;
    }
    /* Commented Backslash Hack hides rule from IE5-Mac \*/
    #tabsI a span {float:none;}
    /* End IE5-Mac hack */
    #tabsI a:hover span {
    color:#FFF;
    }
    #tabsI a:hover {
    background-position:0% -42px;
    }
    #tabsI a:hover span {
    background-position:100% -42px;
    }

    #tabsI a.selected {
    background: url('images/lefts.gif') no-repeat left top;
    }

    #tabsI a.selected span {
    background:url("images/rights.gif") no-repeat right top;

    }

    -------------------------
    This is the code for my html file

    For some weird reason the link href written in blue isnt working,

    <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
    <title>menu test</title>
    <link href="css/menu.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="js/menus.js"></script>

    </head>

    <body>
    <div id="tabsI">
    <ul>
    <li><a onclick="applySelectedTo(this);return false;" href="#" class="selected" title="Link 1"><span>Home</span></a></li>
    <li><a onclick="applySelectedTo(this);return false;" href="#" title="Link 2"><span>Link 2</span></a></li>
    <li><a onclick="applySelectedTo(this);return false;" href="#" title="Link 3"><span>Link 3</span></a></li>
    <li><a onclick="applySelectedTo(this);return false;" href="#" title="Longer Link Text"><span>Longer Link Text</span></a></li>
    <li><a onclick="applySelectedTo(this);return false;" href="#" title="Link 5"><span>Link 5</span></a></li>
    <li><a onclick="applySelectedTo(this);return false;" href="#" title="Link 6"><span>Link 6</span></a></li>
    <li><a onclick="applySelectedTo(this);return false;" href="#" title="Link 7"><span>Link 7</span></a></li>
    </ul>
    </div>

    </body>

    </html>

    just to inform you all, I have tested the css code in my html file so it is working, just went im trying to link them its not!

    Thanx for the help
    Last edited by coolioi; 01-10-2010 at 02:59 PM.

  • #2
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    Do you mean the images aren't working? That's because you're referencing images that should be under css/images, which I presume they're not. Use "../images/" instead, making the browser go up a directory.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •