Jump to content

float problems?


dadamssg

Recommended Posts

im trying to just get a layout down. I can't seem to get the floats right. Im just aiming for a header aread, nav horizontal button bar right underneath it, a side column, and then the main content. i have the side column where i want it but the main content div won't come up to the header/nav button bar section. It just hangs caddy corner to the sidebar. how do i get it to push up to touch the header area?

 

<!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" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />

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

<body>

<div id="all">
all
<div id="header">header</div>
<div id="buttons">buttons</div>
<div id="nav">nav bar<br><br><br><br><br><br><br><br><br></div>
<div id="main">main content</div>
<div id="left">Left bar</div>
<div id="right">Right bar</div>
<div id="footer">Footer</div>
</div>
</body>
</html>

 

/*layout.css*/

#all {
  border: 2px black solid;
  width: 940px;
  margin-right: auto;
  margin-left: auto;
  text-align: left;
}

#header {
   height: 120px;
   border: 1px black solid;
}

* html #nav a {
height: 1px;
}

#buttons {
border: 1px black solid;
height: 35px;
}
#nav {
   width: 170px;
   border: 1px black solid;
   background: url(bg_story.png) repeat-y;
  
}
* html #nav a {
height: 1px;
}

#main {
margin-left: 180px;
border: 1px black solid;

width: 600px;
}

body {
   margin: 0;
   padding: 0;
   background-color: white;
   text-align: center;
}

Link to comment
https://forums.phpfreaks.com/topic/142744-float-problems/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.