---
title: "Div och CSS i annat än IE"
type: "forum-thread"
url: "https://www.webforum.nu/amne/html-css/81823-div-och-css-i-annat-än-ie"
topic: "HTML & CSS"
topic_url: "https://www.webforum.nu/amne/html-css"
author: "icaaq"
published: "2003-07-11T14:54:24.000Z"
updated: "2003-07-16T13:38:23.000Z"
replies: 5
views: 231
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/81823-div-och-css-i-annat-än-ie"
---

# Div och CSS i annat än IE

## #1 — icaaq, 2003-07-11T14:54Z

Jag har följande:

```
[red]
<table id="dList" class="dList" cellspacing="0" border="0" style="border-collapse:collapse;">
	<tr>
		<td>
			<div class="dHeadLeft">
				icaa
			</div>
			<div class="dHeadRight">
				<a class="imgemail" href="mailto:"><img src="/guestbook/img/email.gif" alt="skicka epost till skribenten." border="0" /></a><a id="dList__ctl0_GoToHomepage" class="imghome" href="http://"><img src="/guestbook/img/home.gif" alt="Skribentens hemsida." border="0" /></a>11 juli
			</div>
			<div class="dListMess">
				Här kommer det text
			</div>
		</td>
	</tr>
</table>[/red]
```

och 

```
[red]
.dList
{
	width: 100%;
}
.dHeadLeft
{
	margin: 20px 0px 0px 0px;
	font-weight: normal;
	font-size: 9pt;	
	color: #000;
	font-style: normal;
	font-family: Verdana, Arial, Courier;
	font-variant: normal;
	border-top: #000000 1px solid;
	border-left: #000000 1px solid;
	border-bottom: #000000 1px solid;
	background-color: #dcdcdc;
	clear: left;
	float: left; 
	width: 50%;
	height: 25px;
}
.dHeadRight
{
	margin: 20px 0px 0px 0px;
	font-weight: normal;
	font-size: 9pt;	
	color: #000;
	font-style: normal;
	font-family: Verdana, Arial, Courier;
	font-variant: normal;
	border-top: #000000 1px solid;
	border-right: #000000 1px solid;
	border-bottom: #000000 1px solid;
	background-color: #dcdcdc;
	clear:  right;
	float: right;
	width: 50%;
	height: 25px;
}
.dlistMess
{
	font-weight: normal;
	font-size: 9pt;
	color: #000;
	font-style: normal;
	font-family: Verdana, Arial, Courier;
	background-color: #f5f5f5;
	border-bottom: #000000 1px solid;
	border-right: #000000 1px solid;
	border-left: #000000 1px solid;
	padding: 3px;
	clear: both;
	width: 100%;
	height: 40px;
}[/red]
```

i IE ser det bra ut men jag har problem med bl. a Mozilla, för där ligger allt huller om buller. 

Jag har en XHTML DTD:

```
[red]
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
[/red]
```

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

## #2 — jarvklo, 2003-07-12T23:16Z

Hmm...
Det verkar bero på hur de tolkar "float" och "clear"...
Men om du kör med följande lätt "kommentarsfriserade" CSS (du behöver antagligen inte "floata" och "cleara" allt ;) ) så verkar det kunna funka,  iaf med den kod du lade upp här ;) :

```
.dList
{
	width: 100%;
}
.dHeadLeft
{
	margin: 20px 0px 0px 0px;
	font-weight: normal;
	font-size: 9pt;	
	color: #000;
	font-style: normal;
	font-family: Verdana, Arial, Courier;
	font-variant: normal;
	border-top: #000000 1px solid;
	border-left: #000000 1px solid;
	border-bottom: #000000 1px solid;
	background-color: #dcdcdc;
  clear: left;
	float: left; 
	width: 50%;
	height: 25px;
}
.dHeadRight
{
	margin: 20px 0px 0px 0px;
	font-weight: normal;
	font-size: 9pt;	
	color: #000;
	font-style: normal;
	font-family: Verdana, Arial, Courier;
	font-variant: normal;
	border-top: #000000 1px solid;
	border-right: #000000 1px solid;
	border-bottom: #000000 1px solid;
	background-color: #dcdcdc;
/*	clear:  right; */
/*	float: right; */
	width: 100%; /* 50%; */
 	height: 25px;
}
.dlistMess
{
	font-weight: normal;
	font-size: 9pt;
	color: #000;
	font-style: normal;
	font-family: Verdana, Arial, Courier;
	background-color: #f5f5f5;
	border-bottom: #000000 1px solid;
	border-right: #000000 1px solid;
	border-left: #000000 1px solid;
	padding: 3px;
/*	clear: both; */
	width: 100%;
	height: 40px;
}
```

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

## #3 — icaaq, 2003-07-13T06:39Z

Ska testa

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

## #4 — OlleBoop, 2003-07-15T11:42Z

```
<?xml version="1.0" encoding="ISO-8859-1" ?>
```

 
Sätter inte det IE i quirks mode?

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

## #5 — jarvklo, 2003-07-15T13:42Z

Jodå, och det sätter Mozilla m.fl i "Standards" mode...

Men vare sig man tar bort \<?xml?\>-taggen (och ställer MSIE i Standards mode) eller moddar \<!DOCTYPE-taggen (så att både Moz och MSIE går upp i "Quirks" mode) så kvarstår problemet i just detta fall såvitt jag kan få fram ;)

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

## #6 — OlleBoop, 2003-07-16T13:38Z

Jo, det var off-topic sorry... ;)

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

---

Tråden på webben: https://www.webforum.nu/amne/html-css/81823-div-och-css-i-annat-än-ie
