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 5 of 5
  1. #1
    Regular Coder the-dream's Avatar
    Join Date
    Mar 2007
    Location
    Northamptonshire, UK
    Posts
    477
    Thanks
    8
    Thanked 4 Times in 4 Posts

    CSS Links not working!

    My link styles are not working.

    Here is my HTML:
    Code:
    <div class="navlink"><a href="index.php" class="navlink">Base</a> <a href="edit.php" class="navlink">Edit</a></div>
    Here is my CSS:
    PHP Code:
    .navlink {
        
    height20px;
        
    width100%;
        
    background-imageurl(../images/nav_bg.jpg);
        
    text-aligncenter;
        
    text-decorationnone;
    }

    a.navlink {
        
    height20px;
        
    width100px;
        
    background-imageurl(../images/nav_bg.jpg);
        
    text-aligncenter;
        
    text-decorationnone;
    }

    a.navlink:hover {
        
    height20px;
        
    width100px;
        
    background-imageurl(../images/nav_bg_over.jpg);
        
    text-aligncenter;
        
    text-decorationnone;
    }

    a.navlink:active {
        
    height20px;
        
    width100px;
        
    background-imageurl(../nav_bg.jpg);
        
    text-aligncenter;
        
    text-decorationnone;
    }

    a.navlink:visited {
        
    height20px;
        
    width100px;
        
    background-imageurl(../images/nav_bg.jpg);
        
    text-aligncenter;
        
    text-decorationnone;


  • #2
    Regular Coder kewlceo's Avatar
    Join Date
    Mar 2006
    Location
    California, US
    Posts
    484
    Thanks
    1
    Thanked 3 Times in 3 Posts
    Is your style sheet in a folder such as "css"? If your style sheet is in the same directory as your HTML file (or embedded) then remove "../" in the URLs.
    UBERHOST.NET
    Shared, reseller, semidedicated hosting and dedicated server plans.
    DirectAdmin Installatron Money-Back Guarantee 24/7 Support
    Providing "Service Above All Else" since 2005.

  • #3
    Regular Coder the-dream's Avatar
    Join Date
    Mar 2007
    Location
    Northamptonshire, UK
    Posts
    477
    Thanks
    8
    Thanked 4 Times in 4 Posts
    Here is the folder stucture!

    /index.html
    /images/(image name)
    /css/menu.css


    on my index.html page i have:

    <link href="css/menu.css" rel="stylesheet" type="text/css" />


    to link the CSS sheet

  • #4
    New Coder
    Join Date
    May 2007
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Then change url to (images/image.jpg)

  • #5
    Regular Coder kewlceo's Avatar
    Join Date
    Mar 2006
    Location
    California, US
    Posts
    484
    Thanks
    1
    Thanked 3 Times in 3 Posts
    The URLs seem fine, just checking.

    So, with that code then there would be a background of "nav_bg.jpg" behind all the links, and "nav_bg_over.jpg" just over hovered links. Is that what you're shooting for?
    UBERHOST.NET
    Shared, reseller, semidedicated hosting and dedicated server plans.
    DirectAdmin Installatron Money-Back Guarantee 24/7 Support
    Providing "Service Above All Else" since 2005.


  •  

    Posting Permissions

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