Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Old 07-31-2007, 10:54 PM simple div problems
Extreme Talker

Posts: 176
Trades: 0
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
 
 
Register now for full access!
Old 08-01-2007, 09:38 AM Re: simple div problems
Angelosanto's Avatar
Webmaster Talker

Posts: 548
Name: Danny Angelosanto
Trades: 0
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
__________________
"The only reason some people get lost in thought is because it's unfamiliar territory."
_____________________________________
Angelosanto is offline
Reply With Quote
View Public Profile Visit Angelosanto's homepage!
 
Old 08-01-2007, 11:23 AM Re: simple div problems
Extreme Talker

Posts: 176
Trades: 0
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 11:50 AM..
Skeddles is offline
Reply With Quote
View Public Profile
 
Old 08-01-2007, 06:21 PM Re: simple div problems
Angelosanto's Avatar
Webmaster Talker

Posts: 548
Name: Danny Angelosanto
Trades: 0
I could probably tell you that if you link me to the page
__________________
"The only reason some people get lost in thought is because it's unfamiliar territory."
_____________________________________
Angelosanto is offline
Reply With Quote
View Public Profile Visit Angelosanto's homepage!
 
Old 08-01-2007, 07:47 PM Re: simple div problems
Extreme Talker

Posts: 176
Trades: 0
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, 08:23 PM Re: simple div problems
Angelosanto's Avatar
Webmaster Talker

Posts: 548
Name: Danny Angelosanto
Trades: 0
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
__________________
"The only reason some people get lost in thought is because it's unfamiliar territory."
_____________________________________
Angelosanto is offline
Reply With Quote
View Public Profile Visit Angelosanto's homepage!
 
Old 08-01-2007, 08:35 PM Re: simple div problems
Extreme Talker

Posts: 176
Trades: 0
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, 08:36 PM Re: simple div problems
Angelosanto's Avatar
Webmaster Talker

Posts: 548
Name: Danny Angelosanto
Trades: 0
Don't mention it
__________________
"The only reason some people get lost in thought is because it's unfamiliar territory."
_____________________________________
Angelosanto is offline
Reply With Quote
View Public Profile Visit Angelosanto's homepage!
 
Old 08-01-2007, 09:26 PM Re: simple div problems
Extreme Talker

Posts: 176
Trades: 0
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, 09:31 PM Re: simple div problems
Angelosanto's Avatar
Webmaster Talker

Posts: 548
Name: Danny Angelosanto
Trades: 0
Not sure what you mean by that?
__________________
"The only reason some people get lost in thought is because it's unfamiliar territory."
_____________________________________
Angelosanto is offline
Reply With Quote
View Public Profile Visit Angelosanto's homepage!
 
Old 08-01-2007, 09:37 PM Re: simple div problems
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
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 !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 08-01-2007, 09:49 PM Re: simple div problems
Extreme Talker

Posts: 176
Trades: 0
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, 10:14 PM Re: simple div problems
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
Google is your friend

http://css-discuss.incutio.com/?page=AnyColumnLongest
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 08-01-2007, 10:25 PM Re: simple div problems
Angelosanto's Avatar
Webmaster Talker

Posts: 548
Name: Danny Angelosanto
Trades: 0
Thats a pretty good link - does that explain what you need Skeddles?
__________________
"The only reason some people get lost in thought is because it's unfamiliar territory."
_____________________________________
Angelosanto is offline
Reply With Quote
View Public Profile Visit Angelosanto's homepage!
 
Old 08-02-2007, 12:25 AM Re: simple div problems
Extreme Talker

Posts: 176
Trades: 0
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 Search this Thread
Search this Thread:

Advanced Search

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

BB 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.42424 seconds with 12 queries