Reply
simple div problems
Old 07-31-2007, 09:54 PM simple div problems
Skilled Talker

Posts: 92
It produces the right things, but they are one on top of each other. I want div.top all the across the top, div.left to stay on the left, div.right to stay on the right, and div.middle to stay in the middle(and be as big as it can without changing the content of the left or right. Bottom same as top.

Heres the CSS
Code:
div.top
{
background-color:gray;
width:100%;
margin:0px;
}

div.left
{
width:160px;
background-color:#ff0000;
}

div.middle
{
background-color:#00ff00;
}

div.right
{
width:160px;
background-color:#0000ff;
}

div.bottom
{
width:100%;
background-color:gray;
}
HTML:
Code:
<html>
<head>
    <title>Pixel Geeks</title>
    <link rel="stylesheet" type="text/css" href="mystyle.css" />
</head>
<body>

<div class="top">Top</div>
<div class="left">left<br/>left<br/>left<br/></div>
<div class="middle">Middle</div>
<div class="right">right<br/>right<br/>right<br/></div>
<div class="bottom">Bottom</div>

</body>
</html>
Skeddles is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 08-01-2007, 08:38 AM Re: simple div problems
Angelosanto's Avatar
Ultra Talker

Posts: 440
Name: Danny Angelosanto
You need to make use of the float property

I think if you float the left and middle divs to the left, and your right div to the right, it should display how you want it
Angelosanto is offline
Reply With Quote
View Public Profile Visit Angelosanto's homepage!
 
Old 08-01-2007, 10:23 AM Re: simple div problems
Skilled Talker

Posts: 92
Quote:
Originally Posted by Angelosanto View Post
You need to make use of the float property

I think if you float the left and middle divs to the left, and your right div to the right, it should display how you want it
thank you, that worked.

Now it looks almost perfect, but how can I make the sections stretch (such as make the middle strech all the way to the right untill it hits the right div?

CSS:
Code:
#content a:link, #content a:visited
{
color:#bbdaa9;
font-weight:normal;
text-decoration:none;
}

#content a:hover, #content a:active
{
color:#cc8a52
font-weight:normal;
text-decoration:line-through;
}

/* tables */

div.container
{
width:100%;
margin:0px;
border:1px solid gray;
min-height:500;
}

div.top
{
clear:left;
background-color:gray;
width:100%;
}

div.left
{
float:left;
width:160px;
background-color:#ff0000;
}

div.middle
{
float:left;
min-height:500;
background-color:#00ff00;
}

div.right
{
float:right;
width:160px;
background-color:#0000ff;
}

div.bottom
{
clear:left;
float:none;
width:100%;
background-color:gray;
}
HTML:
Code:
<html>
<head>
    <title>Pixel Geeks</title>
    <link rel="stylesheet" type="text/css" href="mystyle.css" />
</head>
<body>


<div class="top">Top</div>

<div class="left">
<center>
Link<br/>
Link<br/>
Link<br/>
</center>
</div>

<div class="middle">Middle</div>

<div class="right">
<center>
Link<br/>
Link<br/>
Link<br/>
</center>
</div>

<div class="bottom">Bottom</div>

</body>
</html>

Last edited by Skeddles : 08-01-2007 at 10:50 AM.
Skeddles is offline
Reply With Quote
View Public Profile
 
Old 08-01-2007, 05:21 PM Re: simple div problems
Angelosanto's Avatar
Ultra Talker

Posts: 440
Name: Danny Angelosanto
I could probably tell you that if you link me to the page
Angelosanto is offline
Reply With Quote
View Public Profile Visit Angelosanto's homepage!
 
Old 08-01-2007, 06:47 PM Re: simple div problems
Skilled Talker

Posts: 92
Quote:
Originally Posted by Angelosanto View Post
I could probably tell you that if you link me to the page
http://www.freewebs.com/skeddles/blank.htm
http://www.freewebs.com/skeddles/mystyle.css

I want the red blue and green to fill up that space.
Skeddles is offline
Reply With Quote
View Public Profile
 
Old 08-01-2007, 07:23 PM Re: simple div problems
Angelosanto's Avatar
Ultra Talker

Posts: 440
Name: Danny Angelosanto
I'd like to reccomend to you a bit of a change in the way you have approached it (not that your way was bad )

Firstly, use a wrapper div to go around the entire thing, all the other divs can be put into that.

Set the wrapper divs width to 100%

Then set all other divs widths to percentage values, e.g. left 10%, right 10% and middle 80%.

This way, your sit will always fill the screen and your middle div will touch both its surrounding divs

I'll also point out that the 'min-height' property doesn't work in IE6, so you might want to reconsider that
Angelosanto is offline
Reply With Quote
View Public Profile Visit Angelosanto's homepage!
 
Old 08-01-2007, 07:35 PM Re: simple div problems
Skilled Talker

Posts: 92
Quote:
Originally Posted by Angelosanto View Post
I'd like to reccomend to you a bit of a change in the way you have approached it (not that your way was bad )

Firstly, use a wrapper div to go around the entire thing, all the other divs can be put into that.

Set the wrapper divs width to 100%

Then set all other divs widths to percentage values, e.g. left 10%, right 10% and middle 80%.

This way, your sit will always fill the screen and your middle div will touch both its surrounding divs

I'll also point out that the 'min-height' property doesn't work in IE6, so you might want to reconsider that
Ok. I had that at one point, but got rid of for some reason. And ya I noticed the height thing. Thank you for all your help.
Skeddles is offline
Reply With Quote
View Public Profile
 
Old 08-01-2007, 07:36 PM Re: simple div problems
Angelosanto's Avatar
Ultra Talker

Posts: 440
Name: Danny Angelosanto
Don't mention it
Angelosanto is offline
Reply With Quote
View Public Profile Visit Angelosanto's homepage!
 
Old 08-01-2007, 08:26 PM Re: simple div problems
Skilled Talker

Posts: 92
Quote:
Originally Posted by Angelosanto View Post
Don't mention it
WAIT!! But what about the height? Is there a way to keep them all the same if one section needs more room?
Skeddles is offline
Reply With Quote
View Public Profile
 
Old 08-01-2007, 08:31 PM Re: simple div problems
Angelosanto's Avatar
Ultra Talker

Posts: 440
Name: Danny Angelosanto
Not sure what you mean by that?
Angelosanto is offline
Reply With Quote
View Public Profile Visit Angelosanto's homepage!
 
Old 08-01-2007, 08:37 PM Re: simple div problems
LadynRed's Avatar
Super Moderator

Posts: 6,557
Location: Tennessee
Yes.. but the easiest way to FAKE the look of equal-length columns is the faux columns method.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!
"Using or working with IE is like having to wear a 1970's polyester suit with pantyhose and a girdle, to work everyday"
Carolina Corvette Club
LadynRed is offline
Reply With Quote
View Public Profile
 
Old 08-01-2007, 08:49 PM Re: simple div problems
Skilled Talker

Posts: 92
Quote:
Originally Posted by LadynRed View Post
Yes.. but the easiest way to FAKE the look of equal-length columns is the faux columns method.
What's that?
Skeddles is offline
Reply With Quote
View Public Profile
 
Old 08-01-2007, 09:14 PM Re: simple div problems
LadynRed's Avatar
Super Moderator

Posts: 6,557
Location: Tennessee
Google is your friend

http://css-discuss.incutio.com/?page=AnyColumnLongest
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!
"Using or working with IE is like having to wear a 1970's polyester suit with pantyhose and a girdle, to work everyday"
Carolina Corvette Club
LadynRed is offline
Reply With Quote
View Public Profile
 
Old 08-01-2007, 09:25 PM Re: simple div problems
Angelosanto's Avatar
Ultra Talker

Posts: 440
Name: Danny Angelosanto
Thats a pretty good link - does that explain what you need Skeddles?
Angelosanto is offline
Reply With Quote
View Public Profile Visit Angelosanto's homepage!
 
Old 08-01-2007, 11:25 PM Re: simple div problems
Skilled Talker

Posts: 92
Quote:
Originally Posted by Angelosanto View Post
Thats a pretty good link - does that explain what you need Skeddles?
Not really, I just decided to go with a fixed height. But now it only works in fire fox, not IE! Whats up with that?
Skeddles is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to simple div problems
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.31815 seconds with 12 queries