body {
background: #ddd;
margin: 40px 0;
text-align: center;
}
#container {
width: 700px;
margin: 0 auto;
}
#header {
background: #fc784;
width: 100%;
height: 30px;
padding-top: 15px;
}
#content {
background: #ff99cc;
float: left;
width: 400px;
text-align: left;
}
#leftbar {
background: #f87c2;
float: left;
width: 150px;
}
#leftbar2 {
background: #f87c2;
float: left;
width: 150px;
}
#rightbar {
background: #f87c2;
float: right;
width: 150px;
}
Css layout
Started by shawna, Dec 08 2005 06:32 AM
9 replies to this topic
#1
Posted 08 December 2005 - 06:32 AM
Hi, I need to make rows in my layout. I'm doing it from pur css with no tables just divs. Here's what I have so far starting at "leftbar2" I want it to be a row as well as what I put below "rightbar" and "content"
#2
Posted 08 December 2005 - 04:24 PM
Technically speaking, a div is a row, so you don't need to do anything special to make it so. The hard part about tables in CSS is the columns.
In other words, if you're making rows... just add a <div> and wala, you have a row. Of course, using float on a div will mess things up. Try taking that off.
In other words, if you're making rows... just add a <div> and wala, you have a row. Of course, using float on a div will mess things up. Try taking that off.
Edited by rc69, 08 December 2005 - 04:25 PM.
#3
Posted 08 December 2005 - 07:33 PM
Also, if you want a div that stretches the entire way across the screen, you'll need to make the width:100%, otherwise you could take it out entirely
#4
Posted 08 December 2005 - 11:38 PM
ok,I feel very dumb right now...lol
I put div id="blah' but it goes next to it instead of under it so,left bar 2 should take off the float? or all of them? I also haven't the slightest of how to make rounded corners with css for divs GAH!!
I put div id="blah' but it goes next to it instead of under it so,left bar 2 should take off the float? or all of them? I also haven't the slightest of how to make rounded corners with css for divs GAH!!
#6
Posted 09 December 2005 - 02:24 AM
lol well thx for the link.
What I meant was should I take off "float"? But I tried it and when i take it off it messes everything else up. when I try centering the content area,that messes up too. So I am totally lost on what else to do.
This is my html with the same css layout above
What I meant was should I take off "float"? But I tried it and when i take it off it messes everything else up. when I try centering the content area,that messes up too. So I am totally lost on what else to do.
This is my html with the same css layout above
<div id="container"> <div id="header"> banner <div id="leftbar"> <p>Link <br>Link <br>Link </p> </div> <div id="leftbar2"> <p><img src="images/vidsub.gif"> </div> <div id="content"> The center stuff </div> <div id="rightbar"> Some text on the right </div> </div>
#7
Posted 09 December 2005 - 06:31 AM
If thats the exact code, then your missing a closing
#8
Posted 09 December 2005 - 11:01 AM
oh,I must have missed it when I was trying to cut out some of the blibberish I had to test it. But no,it's in my actual code though
#9
Posted 09 December 2005 - 04:39 PM
edit, you have to remove float:left;
if it messes up when you do that, you have to recode the layou then.
if it messes up when you do that, you have to recode the layou then.
Edited by coolaid, 09 December 2005 - 04:40 PM.
#10
Posted 09 December 2005 - 08:55 PM
I fixed it. It was ordered wrong...
