Web Layout
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsWeb DesignWeb Layout

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old July 27th, 2006, 01:08 AM
monkeynote monkeynote is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 5 monkeynote User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 52 m 9 sec
Reputation Power: 0
Arrow Newbie need help on CSSP floats problem

hello guys!

im new to CSS positioning and i would like to ask for guidance about my test layout using floats.

i have a some divs that is inside my #container div. but my problem is, it displays ok in IE but not in mozilla or opera here's my layout that i want to achieve,

Code:
|-----Container------|
||------------------||
||      Header      ||
||------------------||
||left      | right ||
||          |       ||
||          |       ||
||          |       ||
||          |       ||
||          |       ||
||------------------||
|| Footer           ||
||------------------||
|--------------------|


and here's my code
Code:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!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" />
<style type="text/css">
		*{
			border:0px; 
			padding:0px; 
			margin:0px;
		}
		body{
			font-family:"Trebuchet MS", Arial, sans-serif;	font-size:12px; font-weight:bold;
		}
		#Container{
			width:720px;
			padding:10px; 
			border:1px black solid;
			margin:0 auto; 
			background:#CCC;
		}
		#Header{
			width:700px;
			padding:0px 9px;
			height:99px;			
			border:1px black solid;
			margin:0 auto; 
			background:#FFF;
		}
		#leftFloat{
			float:left; 
			width:500px; 
			padding: 0px 9px;
			border:1px black solid;
			background:#EEE;
		}
		#rightFloat{
			float:right; 
			width:180px; 
			padding: 0px 9px;
			border:1px black solid;
			background:#DDD;
		}
		#footerFloat{
			float:left; 
			clear:both; 
			width:700px; 
			padding: 0px 9px;
			border:1px black solid;
			background:#777;
		}
</style>
<title>Test Float</title>
</head>
<body>
	<div id="Container">
		<div id="Header">
			<h1>Header</h1>
		</div>
		<div id="leftFloat" >
			leftfloat<br />leftfloat<br />leftfloat<br />leftfloat<br />leftfloat<br />
		</div>
		<div id="rightFloat">
			rightfloat<br />rightfloat<br />rightfloat<br />rightfloat<br />rightfloat<br />
		</div>
		<div id="footerFloat" >
			footerfloat footerfloat<br />footerfloat footerfloat footerfloat
		</div>
	</div>
</body>
</html>


i hope that you can help me with my problem im totally newbie in CSS... wah!

Reply With Quote
  #2  
Old July 27th, 2006, 02:06 AM
monkeynote monkeynote is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 5 monkeynote User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 52 m 9 sec
Reputation Power: 0
i solved my problem by using overflow:hidden in my container div but my new problem is when i fill my leftFloat with a lot of break tags <br /> my rightfloat div does not expand down to my footer. also, in firefox, my rightfloat is pushed down at the bottom!

how can i align both my left and right floats together? how can i also solve my firefox bug? i hope that you can help me with my problem guys

Reply With Quote
  #3  
Old July 27th, 2006, 08:27 AM
banker's Avatar
banker banker is offline
Charging Rhino Wizard
ASP Free Regular (2000 - 2499 posts)
 
Join Date: Dec 2004
Location: 127.0.0.1
Posts: 2,053 banker User rank is Sergeant Major (2000 - 5000 Reputation Level)banker User rank is Sergeant Major (2000 - 5000 Reputation Level)banker User rank is Sergeant Major (2000 - 5000 Reputation Level)banker User rank is Sergeant Major (2000 - 5000 Reputation Level)banker User rank is Sergeant Major (2000 - 5000 Reputation Level)banker User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 5 Days 23 h 28 m 28 sec
Reputation Power: 36
Get it working in Mozilla first, you can always go back and fix it for IE...not the other way around.

Try removing all padding from your container and floats...then re-adjust your width to and padding until it fits in Mozilla. Then, go back and use IE Conditional Comments to fix it for IE.
__________________
ShepherdWeb :: Charging Rhino Wizard

I know of no more encouraging fact than the unquestionable ability of man to elevate his life by conscious endeavor.
{Henry David Thoreau}

§ shepherdweb.com
§ fariswheel productions
§ reagan administration

Reply With Quote
  #4  
Old July 27th, 2006, 10:57 PM
monkeynote monkeynote is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 5 monkeynote User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 52 m 9 sec
Reputation Power: 0
great advice banker!

i did first work my page on mozilla and i also removed all the padding and borders in my div. but i have another problem that i want to resolve.

1.) how can i achieve same height in my leftfloat and rightfloat? once my leftfloat is long... how can i make my rightfloat long to make it align with my layout?

2.) how can i also put my footer always at the bottom of my page if my leftfloat and rightfloat is short?
here's my layout looks like after revision
Code:
|-----Container------|
||------------------||
||      Header      ||
||------------------||
||left      | right ||
||          |       ||
||          |-------||
||          |///////||
||          |///////||
||          | right ||
||          |/float/||
||          |//is///||
||          |/short/||
||          |///////||
||          |///////||
||------------------||
||      Footer      ||
||should always here||
||------------------||
|--------------------|


and also, here's my revised code

Code:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css">
		*{
			border:0px; 
			padding:0px; 
			margin:0px;
		}
		body{
			font-family:"Trebuchet MS", Arial, sans-serif;	font-size:12px; font-weight:bold;
		}
		#Container{
			width:740px;
			border:1px black solid;
			margin:0 auto; 
			background:#CCC;
			overflow: hidden;
		}
		#Header{
			width:740px;
			margin:0 auto; 
			background:#FFF;
			height:100px;
		}
		#leftFloat{
			float:left; 
			width:520px; 
			background:#EEE;
		}
		#rightFloat{
			float:right; 
			width:220px; 
			background:#DDD;
			clear:right;
		}
		#Footer{
			float:left; 
			clear:both; 
			width:740px; 
			height:50px;
			background:#777;
		}
</style>
<title>Test Float</title>
</head>
<body>
	<div id="Container">
		<div id="Header">
			<h1>Header</h1>
		</div>
		<div id="leftFloat" >
			<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
		</div>
		<div id="rightFloat">
			rightfloat<br />rightfloat<br />rightfloat<br />rightfloat<br />rightfloat<br />
		</div>
		<div id="Footer" >
			footerfloat footerfloat footerfloat footerfloat footerfloat
		</div>
	</div>
</body>
</html>


i'm so frustrated about my layout simple as it looks but its so cumbersome to do.

Reply With Quote
  #5  
Old July 28th, 2006, 08:02 AM
banker's Avatar
banker banker is offline
Charging Rhino Wizard
ASP Free Regular (2000 - 2499 posts)
 
Join Date: Dec 2004
Location: 127.0.0.1
Posts: 2,053 banker User rank is Sergeant Major (2000 - 5000 Reputation Level)banker User rank is Sergeant Major (2000 - 5000 Reputation Level)banker User rank is Sergeant Major (2000 - 5000 Reputation Level)banker User rank is Sergeant Major (2000 - 5000 Reputation Level)banker User rank is Sergeant Major (2000 - 5000 Reputation Level)banker User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 5 Days 23 h 28 m 28 sec
Reputation Power: 36
This is a classic problem with floats. I've solved this problem two ways:
  • If you know how high the floats need to be, set the height attribute on both to be the same. This method is hard to get working consistently...especially if you have text in your columns.
  • My favorite solution is doing faux columns. It's pretty easy to implement, it validates, and your users will never know the difference!

Reply With Quote
Reply

Viewing: ASP Free ForumsWeb DesignWeb Layout > Newbie need help on CSSP floats problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway