Jump to content


Css layout


9 replies to this topic

#1 shawna

    Young Padawan

  • Members
  • Pip
  • 46 posts
  • Gender:Female
  • Location:Jacksonville,Florida
  • Interests:Web Design,music,I'm a vocalist and wannabe guitarist. I'm a female of course if you haven't noticed by my name. I'm a vegetarian,and I like to help people out when I can.99% of the time,I'm partially wrong : ) so don't yell at me if I am kaythxbye

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"
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;
}


#2 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

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.

Edited by rc69, 08 December 2005 - 04:25 PM.


#3 Ghost

    Honored P2L Member

  • P2L Staff
  • PipPipPip
  • 675 posts
  • Gender:Male
  • Location:Australia

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 shawna

    Young Padawan

  • Members
  • Pip
  • 46 posts
  • Gender:Female
  • Location:Jacksonville,Florida
  • Interests:Web Design,music,I'm a vocalist and wannabe guitarist. I'm a female of course if you haven't noticed by my name. I'm a vegetarian,and I like to help people out when I can.99% of the time,I'm partially wrong : ) so don't yell at me if I am kaythxbye

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!!

#5 Ghost

    Honored P2L Member

  • P2L Staff
  • PipPipPip
  • 675 posts
  • Gender:Male
  • Location:Australia

Posted 09 December 2005 - 01:14 AM

Ok, you've lost me :D

But...I know how to do the round corners :P I was looking for it a few days ago :P Have you tried this tutorial?

#6 shawna

    Young Padawan

  • Members
  • Pip
  • 46 posts
  • Gender:Female
  • Location:Jacksonville,Florida
  • Interests:Web Design,music,I'm a vocalist and wannabe guitarist. I'm a female of course if you haven't noticed by my name. I'm a vegetarian,and I like to help people out when I can.99% of the time,I'm partially wrong : ) so don't yell at me if I am kaythxbye

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
<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 Ghost

    Honored P2L Member

  • P2L Staff
  • PipPipPip
  • 675 posts
  • Gender:Male
  • Location:Australia

Posted 09 December 2005 - 06:31 AM

If thats the exact code, then your missing a closing
:angry: That could be part of the problem.

#8 shawna

    Young Padawan

  • Members
  • Pip
  • 46 posts
  • Gender:Female
  • Location:Jacksonville,Florida
  • Interests:Web Design,music,I'm a vocalist and wannabe guitarist. I'm a female of course if you haven't noticed by my name. I'm a vegetarian,and I like to help people out when I can.99% of the time,I'm partially wrong : ) so don't yell at me if I am kaythxbye

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 coolaid

    P2L Jedi Master

  • Members
  • PipPipPipPip
  • 1,435 posts
  • Gender:Male
  • Interests:i wonder..

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.

Edited by coolaid, 09 December 2005 - 04:40 PM.


#10 shawna

    Young Padawan

  • Members
  • Pip
  • 46 posts
  • Gender:Female
  • Location:Jacksonville,Florida
  • Interests:Web Design,music,I'm a vocalist and wannabe guitarist. I'm a female of course if you haven't noticed by my name. I'm a vegetarian,and I like to help people out when I can.99% of the time,I'm partially wrong : ) so don't yell at me if I am kaythxbye

Posted 09 December 2005 - 08:55 PM

I fixed it. It was ordered wrong...





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users