2 replies [Last post]
dno
Offline
newbie
Asia / Taiwan / Taoyuan
Last seen: 16 years 34 weeks ago
Asia / Taiwan / Taoyuan
Timezone: GMT+8
Joined: 2004-04-02
Posts: 2
Points: 0

hi there!

i'm trying to do a layout like this

i made the code. and it looking fine in IE 6

but not working with mozilla 1.6 :oops:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8"><title>Untitled</title>
	
	<style type="text/css" media="all">

	body {
		background-color:#000000;
		}

	#outer
		{
		width: 750px;
		margin: auto;
		background-color: #333333;
		}
	#name
		{
		background-color: #666666;
		}
	#sidebar
		{
		float: left;
		width: 170px;
		background-color: #999999;
		}
	#itembody
		{
		float: left;
		width: 550px;
		background-color: #CCCCCC;		
		}
</style></head>

<body>

<div id="outer">
<div id="name"><h2>Site Name</h2></div>
<div id="sidebar">
<p>Sidebar</p>
<p>Sidebar</p>
<p>Sidebar</p>
<p>Sidebar</p>
</div>
<div id="itembody">
<p>itembody</p>
<p>itembody</p>
<p>itembody</p>
<p>itembody</p>
<p>itembody</p>
<p>itembody</p>
</div>
</div>
</body></html>

Stu
Stu's picture
Offline
Enthusiast
Bristol uk
Last seen: 16 years 45 weeks ago
Bristol uk
Joined: 2004-01-20
Posts: 282
Points: 0

Multi Layout ?

You will need to 'clear' the floating divs to allow the outer div to contain them.

add to css

.clear {clear:both;}

and add the html

Quote:
<p>itembody</p>
</div>
<div class="clear"></div>
&nbsp;
</div>
</body></html>

It's not what you do it's the way that you do it.
So do it with STYLE
http://www.s7u.co.uk

dno
Offline
newbie
Asia / Taiwan / Taoyuan
Last seen: 16 years 34 weeks ago
Asia / Taiwan / Taoyuan
Timezone: GMT+8
Joined: 2004-04-02
Posts: 2
Points: 0

Multi Layout ?

Thanks , it work fine now Laughing out loud