Reply
Float, layout problem.
Old 02-19-2007, 07:51 AM Float, layout problem.
feraira's Avatar
BeTheBand!

Posts: 313
I want a 3 column layout, I have designed it so far and I have just bumped into a problem. Evertime there is text on the right side (float:right it makes the main (middle) section go down and start at the bottom of the text.. ?

HTML Code:
body {
	font-family:Arial, Helvetica, sans-serif;
	font-size:100%;
	background-color: #333333;
	color: #CCCCCC;
}
#main {
	font-family:Arial, Helvetica, sans-serif;
	font-size:100%;
	background-color: #333333;
	color: #CCCCCC;
	border-left: 2px solid #000000;
	border-right: 2px solid #000000;
	border-bottom: 2px solid #000000;
	width: 60%;
	margin-left:auto;
	margin-right: auto;
	padding:5px;
	clear:both;
}
#right {
	width:20%;
	float:right;
	text-align:right;
}
#left {
	width:20%;
	float: left;
}
#top {
	width:100%;
	margin-left:auto;
	margin-right:auto;
	text-align:center;
	padding-bottom:5px;
}
#footer {
	clear:both;
	font-size:90%;
	text-align:center;
	margin-left:auto;
	margin-right:auto;
	border: 2px solid #000000;
	width:25%;
	padding:2px;
}
p {
	font-size: 90%;
	color: #CCCCCC;
}
h1 {
	font-size: 200%;
	font-weight: bold;
	text-align:center;
	line-height: 30%;
	color: #00FF00;
}
h2 {
	font-size: 150%;
	font-weight: bold;
	text-align:left;
	line-height:30%;
	color: #00FF00;
}
h3 {
	font-size: 110%;
	font-weight: bold;
	text-align:left;
	line-height:30%;
	color:#00FF00;
}
#right h3 {
	text-align:right;
}
a {
	color: #0099ff;
	text-decoration:none;
}
HTML Code:
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Be The Band - Can You Manage It?</title>

<link rel="stylesheet" type="text/css" href="inc/style.css" />

</head>
<body>

<div id="top">
<p>TOP</p>
</div>

<div id="left">
<h3>Login</h3>
</div>

<div id="right">
<h3>Statistics</h3>

<p><strong>Registered Users:</strong> 32847</p>
<p><strong>Users signed up today:</strong> 4737</p>
<p><strong></strong></p>

</div>

<div id="main">
<h1>Be The Band</h1>

<h3>What is Be The Band?</h3>

<p><strong>Be The Band</strong> is a new revolutionary online multiplayer game that can be played by anyone, anywhere. When you join, you are a manager. The idea of being the manager is to hire musicians, train them to make them better and get them better instruments. Eventually you will be able to go against other players to fight for the #1 spot in the leagues.</p>

<p>Throughout <strong>Be The Band</strong> you will be able to interact with other players, hire musicians, buy new instruments and train your musicians. As well as being in charge of the band, you are also in charge of their welfare! Be careful, because if one of the bands musicians doesn't like it; you might find yourself not able to do any gigs!</p>

<h3>What do I need and how do I play?</h3>

<p>In order to play, you must have internet access, at home, at work, wherever. You need to have a passion for games not forgetting a passion for music if you're wanting to be the #1 band in the league tables of <strong>Be The Band</strong>.</p>

<p>You can signup by either using the <a href="#" title="">registration form</a> or an invitation link sent to you by a friend. Also, for a full complete guide to our rules and a game FAQ, just use the help link at the top of the page!</p>

<h3>Screenshots</h3>
</div>

<div id="footer">
Copyright &copy; Be The Band 2007
</div>

</body>
</html>
__________________
www.alldrumtabs.com
feraira is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 02-19-2007, 03:09 PM Re: Float, layout problem.
LadynRed's Avatar
Super Moderator

Posts: 6,562
Location: Tennessee
Your #main is 60% PLUS 10px of padding. This is more than likely the cause of your float drop as your total EXCEEDS 100%. I'm going to assume the problem is only occurring in IE, since it's box model is broken.

http://www.positioniseverything.net/ie-primer.html

Add the padding or margin to the content INSIDE the #main div.
Or, reduce the 60% to a smaller number.
__________________
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 02-19-2007, 03:53 PM Re: Float, layout problem.
feraira's Avatar
BeTheBand!

Posts: 313
I fixed the problem by adding:
position:absolute;

in the #main.


I also have another issue now on a menu im trying to make.
All the text is piled on-top of each other (absolute) but when i change it to relative it pushes text below it out of the way...

Clump of text (absolute):
http://img122.imageshack.us/img122/2078/clumphc1.jpg

Relative; pushing outa way:
http://img258.imageshack.us/img258/4443/pushme3.jpg
__________________
www.alldrumtabs.com
feraira is offline
Reply With Quote
View Public Profile
 
Old 02-19-2007, 04:16 PM Re: Float, layout problem.
feraira's Avatar
BeTheBand!

Posts: 313
Quote:
Originally Posted by feraira View Post
I fixed the problem by adding:
position:absolute;

in the #main.


I also have another issue now on a menu im trying to make.
All the text is piled on-top of each other (absolute) but when i change it to relative it pushes text below it out of the way...

Clump of text (absolute):
http://img122.imageshack.us/img122/2078/clumphc1.jpg

Relative; pushing outa way:
http://img258.imageshack.us/img258/4443/pushme3.jpg
All fixed. I had to add margins and 'height'!
__________________
www.alldrumtabs.com
feraira is offline
Reply With Quote
View Public Profile
 
Old 02-19-2007, 07:57 PM Re: Float, layout problem.
LadynRed's Avatar
Super Moderator

Posts: 6,562
Location: Tennessee
Position:absolute isn't the best solution, and it's likely to cause you more headaches.

There are a whole lot of 3-column solutions here:
http://css-discuss.incutio.com/?page=ThreeColumnLayouts
__________________
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
 
Reply     « Reply to Float, layout problem.
 

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