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
    Sep 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    CSS horizontal menu problem

    Hello

    I tried to create a horizontal menu for a website. The problem is that i can't get it to listen to my pixel size. I need a menu that consists out of 7 items, seperated by 3px whitespace. The first and last item are 111px, the rest 112px.

    is this possible in css and if so how? i am allready getting crazy from trying.

    I know it has something to do with creating a list but then the problem is that i can only use padding: ..EM for setting up the size and that is not my idea. I also know that it is easy to solve with a table, but i refuse to use it for layout.

    please help

    Greetz kevin

  • #2
    Senior Coder
    Join Date
    Jan 2005
    Location
    Memphis, TN
    Posts
    1,791
    Thanks
    8
    Thanked 131 Times in 129 Posts
    something like:
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
            "http://www.w3.org/TR/html4/strict.dtd">
    <html lang="en">
    <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <title>???</title>
    <style type="text/css">
    * {
    padding: 0;
    margin: 0;
    }
    body {
    background: #666;
    }
    ul {
    list-style: none;
    }
    li {
    float: left;
    }
    li a {
    width: 112px;
    display: block;
    text-align: center;
    margin: 0 3px;
    background: #ffc;
    }
    li a.firstlast {
    width: 111px;
    }
    </style>
    <ul>
    <li><a href="" class="firstlast">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>
    <li><a href="" class="firstlast">link</a></li>
    	
    </head>
    <body>
    </body>
    
    </html>
    Stop making things so hard on yourself.
    i is tugbucket :: help raise tugburg :: Whitehaven Kiwanis


  •  

    Posting Permissions

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