---
title: "Div i samma ordning som med css & utan css"
type: "forum-thread"
url: "https://www.webforum.nu/amne/html-css/145685-div-i-samma-ordning-som-med-css-utan-css"
topic: "HTML & CSS"
topic_url: "https://www.webforum.nu/amne/html-css"
author: "Fuel"
published: "2006-04-18T09:27:39.000Z"
updated: "2006-04-20T10:12:45.000Z"
replies: 11
views: 682
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/html-css/145685-div-i-samma-ordning-som-med-css-utan-css"
---

# Div i samma ordning som med css & utan css

## #1 — Fuel, 2006-04-18T09:27Z

Kanske ett problem för div-master jarvklo ? Jag vill ha utseendet som i den bifogade bilden. Divarna ska ligga i ordningen logo, content, right & copyright. Hela sidan ska vara 100%, right ska vara fast bredd 200px och content auto Ex. 

```
<div id="wrapper">
  <div id="logo"><h1>My website</h1></div>
    <div id="content"><p>My content div asd asd asdsd as dasd sd asds</p></div>
  <div id="right"><p>My right div sad asd ssdas ds asda</p></div>
  <div id="copyright">My copyright</div>
</div>
```

 gärna så enkel css / div upplägg som möjligt och kompatibel. Nån som kan ? jag har inte fått det att lyckas 100% och vill helst undvika position:absolute

Bilagor:

- [skiss.JPG](https://www.webforum.nu/a/10421.jpg)

Permalänk: https://www.webforum.nu/p/145685

## #2 — überfuzz, 2006-04-18T17:38Z

Jag förstår inte vad det är som är själva problemet..? Kan du inte bara sätta upp fyra div:ar. Sen är det bara att bolla med storlekarna.

\#square1 { width: 200px; height: 40px; background: ffffff; border: 1px solid #000000; position: absolute; left: 10px; top: 10px; z-index: 0; }
\#square2 { width: 170px; height: 150px; background: ffffff; border: 1px solid #000000; position: absolute; left: 10px; top: 55px; z-index: 0; overflow: auto;}
\#square3 { width: 25px; height: 150px; background: ffffff; border: 1px solid #000000; position: absolute; left: 185px; top: 55px; z-index: 0; }
\#square4 { width: 200px; height: 35px; background: ffffff; border: 1px solid #000000; position: absolute; left: 10px; top: 210px; z-index: 0; }

smacka in skiten i din html/php-kod.
\<div id="square1"\>\<p\>logo\</p\>\</div\>
\<div id="square2"\>\<p\>innehåll\</p\>\</div\>
\<div id="square3"\>\<p\>meny\</p\>\</div\>
\<div id="square4"\>\<p\>copyright\</p\>\</div\>

Permalänk: https://www.webforum.nu/p/1801573

## #3 — Okkido, 2006-04-18T18:10Z

überfuzz; ditt exempel är värdelöst.

```
#wrapper {width:100%; height:100%}
h1 {width:100%; height: 200px; background: green;}
#content {width:100%; margin-right: -200px; float:left; background: yellow;}
#right {float:right; width: 200px; background: blue}
#copyright {height: 200px; background: red;}

.clear {clear:both;}
```

```
<div id="wrapper">
  <h1>My website</h1>
    <div id="content"><p>My content div asd asd asdsd as dasd sd asds</p></div>
  <div id="right"><p>My right div sad asd ssdas ds asda</p></div>
  <br class="clear" />
  <div id="copyright">My copyright</div>
</div>
```

Där är ett exempel. Fast du kanske vill ha den 100% i height också? isf, är det något i höjdled som ska ha fast värden?

Permalänk: https://www.webforum.nu/p/1801581

## #4 — überfuzz, 2006-04-18T19:02Z

Ok

Permalänk: https://www.webforum.nu/p/1801595

## #5 — Fuel, 2006-04-19T12:54Z

det är fanimig amazing!  :birp det funkar i både FF & Internut Exploder.. kanon ! super ! tack! tror det var här jag har har fastnat på width:100%; margin-right: -200px; har testat width:auto; margin-right: 200px; & liknande   :x

Permalänk: https://www.webforum.nu/p/1801859

## #6 — Fuel, 2006-04-19T13:15Z

oj ..nej det gjorde det inte

texten försvinner i content och logo divven buggar ur i IE .. jobbar vidare

```
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 
"http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<title>Okkido Example</title>
		<style type="text/css">
			#wrapper {width:100%; height:100%}
			#logo { width:100%; height: 80px; background: green;}
			h1 { margin:0; padding:10px; }
			#content { width:100%; margin-right: -200px; float:left; background: yellow;}
			#right {float:right; width: 200px; background: blue}
			#copyright {height: 80px; background: red;}
			.clear {clear:both;}
		</style>
	</head>
	<body>
		<div id="wrapper">
			<div id="logo">
  				<h1>My website</h1>
  			<div>
  			
    		<div id="content">
    			<p>My content div</p>
    			<p>
    				Lorem ipsum ne eius lucilius inimicus vim. 
    				Libris copiosae volutpat sea ut. Congue accusata has ei, mel te tale 
    				virtute scripserit. Qui in solet everti patrioque. Nec ei sonet nusquam 
    				adversarium, est at alii adhuc reprehendunt, vel in nusquam definitionem. 
    				Qui liber graeci propriae ex, ei est viris mediocrem, eum ut adipiscing 
    				comprehensam.
    			</p>
    		</div>
  			<div id="right">
  				<p>My right div</p>
  				<p>
    				Lorem ipsum ne eius lucilius inimicus vim. 
    				Libris copiosae volutpat sea ut. Congue accusata has ei, mel te tale 
    				virtute scripserit. Qui in solet everti patrioque. Nec ei sonet nusquam 
    				adversarium, est at alii adhuc reprehendunt, vel in nusquam definitionem. 
    				Qui liber graeci propriae ex, ei est viris mediocrem, eum ut adipiscing 
    				comprehensam.
    			</p>
  			</div>
  			<br class="clear" />
  			<div id="copyright">
  				<p>My copyright</p>
  			</div>
		</div>
	</body>
</html>
```

kör jag med bara H1 istället för en div runt H1 fungerar den saken iaf, & andra sidan kan jag inte dölja  den taggen och lägga in en bild istället  :l

Permalänk: https://www.webforum.nu/p/1801868

## #7 — Fuel, 2006-04-19T14:57Z

so far so good.. bara problem med content..

```
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 
"http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<title>Okkido Example</title>
		<style type="text/css">
			#wrapper { width:100%; height:100% }
			#logo { width:100%; height: 80px; background: green; }
			h1 { visibility:hidden; background-image:url(); }
			#content { width:100%; margin-right: -200px; float:left; background: yellow; }
			#right { float:right; width: 200px; background: blue }
			#copyright { height: 80px; background: red; clear:both; }
		</style>
	</head>
	<body>
		<div id="wrapper">
			<div id="logo">
  				<h1>My website</h1>
  			</div>
    		<div id="content">
    			<p>My content div</p>
    			<p>
    				Lorem ipsum ne eius lucilius inimicus vim. 
    				Libris copiosae volutpat sea ut. Congue accusata has ei, mel te tale 
    				virtute scripserit. Qui in solet everti patrioque. Nec ei sonet nusquam 
    				adversarium, est at alii adhuc reprehendunt, vel in nusquam definitionem. 
    				Qui liber graeci propriae ex, ei est viris mediocrem, eum ut adipiscing 
    				comprehensam.
    			</p>
    		</div>
  			<div id="right">
  				<p>My right div</p>
  				<p>
    				Lorem ipsum ne eius lucilius inimicus vim. 
    				Libris copiosae volutpat sea ut. Congue accusata has ei, mel te tale 
    				virtute scripserit. Qui in solet everti patrioque. Nec ei sonet nusquam 
    				adversarium, est at alii adhuc reprehendunt, vel in nusquam definitionem. 
    				Qui liber graeci propriae ex, ei est viris mediocrem, eum ut adipiscing 
    				comprehensam.
    			</p>
  			</div>
  		
  			<div id="copyright">
  				<p>My copyright</p>
  			</div>
		</div>
	</body>
</html>
```

Permalänk: https://www.webforum.nu/p/1801910

## #8 — Okkido, 2006-04-19T15:35Z

Vad är det för problem med content?
Och ang. h1:an, har du satt display:block och en width och height på den?

Permalänk: https://www.webforum.nu/p/1801923

## #9 — Fuel, 2006-04-19T16:00Z

Content döljs under right

Permalänk: https://www.webforum.nu/p/1801939

## #10 — Nipon, 2006-04-19T23:10Z

Nja.. För att det där ska funka i "de flesta" webläsare måste man "floata" fler divvar... Och sätta dit en clear-div.

Dessutom måste right vara lika hög eller högre än content-divven. Annars verkar det som om "Content döljs under right". Är den inte det måste man sätta en höjd på right.

Annars funkar detta (utan höjd på right):

```
<html>
<head>
<style type="text/css">
body { margin: 0; padding: 0; }
#wrapper { width: 100%; float:left; }
#logo { width: 100%; float: left; height: 80px; background: green; }
#logo h1 { visibility: hidden; background-image: url(); }
#content { width: 100%; float: left; margin-right: -200px; background: yellow; }
#right { width: 200px; float: right;  background: blue; }
#copyright { width: 100%; float: left; height: 80px; background: red; }
.clear {  clear: both; }
</style>
</head>
<body>
<div id="wrapper">
<div id="logo">
<h1>My logo div</h1>
</div>
<div id="content">
<p>My content div</p>
<p>Lorem ipsum ne eius lucilius inimicus vim. Libris copiosae volutpat sea ut. Congue accusata has ei, mel te tale virtute scripserit. Qui in solet everti patrioque. Nec ei sonet nusquam adversarium, est at alii adhuc reprehendunt, vel in nusquam definitionem. Qui liber graeci propriae ex, ei est viris mediocrem, eum ut adipiscing comprehensam. </p>
</div>
<div id="right">
<p>My right div</p>
<p>Lorem ipsum ne eius lucilius inimicus vim. Libris copiosae volutpat sea ut. Congue accusata has ei, mel te tale virtute scripserit. Qui in solet everti patrioque. Nec ei sonet nusquam adversarium, est at alii adhuc reprehendunt, vel in nusquam definitionem. Qui liber graeci propriae ex, ei est viris mediocrem, eum ut adipiscing comprehensam. </p>
</div>
<div id="clear"></div>
<div id="copyright">
<p>My copyright</p>
</div>
</div>
</body>
</html>
```

Hoppas jag    :l ...

Permalänk: https://www.webforum.nu/p/1802124

## #11 — Fuel, 2006-04-20T08:48Z

Inte i FF

Permalänk: https://www.webforum.nu/p/1802183

## #12 — Nipon, 2006-04-20T10:12Z

Har kollat min kod i IE 6, FF, Opera o Netscape... Funkar finfint!

Vad är det som inte funkar för dig?

Permalänk: https://www.webforum.nu/p/1802203

---

Tråden på webben: https://www.webforum.nu/amne/html-css/145685-div-i-samma-ordning-som-med-css-utan-css
