Results 1 to 3 of 3

Thread: Layout help.

  1. #1
    Join Date
    Feb 2006
    Location
    /usr/local
    Posts
    2,809
    Tokens
    688

    Latest Awards:

    Default Layout help.

    Hey guys,

    I got this problem with my layout:

    (the rollovers keep going to next line isnted of lining up by eachother.)

    How do i fix it??

    Code:

    Html:
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <LINK REL=stylesheet HREF="style.css" TYPE="text/css" />
    <title>Untitled Document</title>
    </head>
    <body>
    <div id="topbar"></div>
    <div id="banner"></div>
    <div id="botbar"><a class="link_rollover" href="#">Home</a><a class="link_rollover" href="#">Home</a></div>
    <div align="center"><div id="content">text</div></div>
    </body>
    </html>
    CSS:
    Code:
    Body {
    	margin: 0px;
    	background: #E0E0E0;
    	font-family: Verdana, Arial, Helvetica, sans-serif;
    }
    #topbar {
    	height: 32px;
    	width: 100%;
    	background: #404040;
    	border-top: 1px solid #B7B7B7;
    	border-bottom: 1px solid #B7B7B7;
    	border-left: 1px solid #B7B7B7;
    	border-right: 1px solid #B7B7B7;
    }
    #banner {
    	height: 32px;
    	width: 100%;
    	background: #FFFFFF;
    	border-left: 1px solid #B7B7B7;
    	border-right: 1px solid #B7B7B7;
    }
    #botbar {
    	height: 32px;
    	width: 100%;
    	background: #404040;
    	border-top: 1px solid #B7B7B7;
    	border-bottom: 1px solid #B7B7B7;
    	border-left: 1px solid #B7B7B7;
    	border-right: 1px solid #B7B7B7;
    	padding-left: 10px;
    	margin-bottom: 10px;
    }
    #content {
    	background: #FFFFFF;
    	width: 800px;
    	border: 1px solid #B7B7B7;
    }
    .link_rollover {
    	text-align: center;
    	display: block;
    	padding-top: 10px;
    	font-size: 11px;
    	color: #FFFFFF;
        width: 78px;
        height: 32px;
        background: url("images/blank_nav.png") no-repeat 0 0;
    }
    .link_rollover:hover { 
        background: url("images/blank_rollover.png") no-repeat 0 0;
    	width: 78px;
    	text-align: center;
    	display: block;
        height: 32px;
    	font-size: 11px;
    	color: #FFFFFF;
    }

  2. #2
    Join Date
    Sep 2004
    Location
    Manchester
    Posts
    59
    Tokens
    0

    Default

    You want a horizontal menu? Throw this in:

    Code:
    #botbar a {
    	float: left;
    }
    This takes the link elements and floats them, in this case to the left. However you're using an inline element ( the anchor tag ) and floats it's independently, you'd be better to wrap those elements in DIVs. So the class '#botbar a' becomes '#botbar div' and the links are <div><a></a></div>.

    You will need to clear this float after the list of menu elements by using a cleaner class as such:

    Code:
    .cleaner {
    clear: both;
    }
    With that in your style sheet add <div class="cleaner"></div> after the menu elements, this will stop things going all squiffy.
    Last edited by Apox; 20-11-2009 at 08:32 PM.

  3. #3
    Join Date
    Feb 2006
    Location
    /usr/local
    Posts
    2,809
    Tokens
    688

    Latest Awards:

    Default

    Thanks, This sorted my problem.

    Alex

Posting Permissions

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