---
title: "Problem med bakgrundsbild i IE"
type: "forum-thread"
url: "https://www.webforum.nu/amne/html-css/142608-problem-med-bakgrundsbild-i-ie"
topic: "HTML & CSS"
topic_url: "https://www.webforum.nu/amne/html-css"
author: "rille77"
published: "2006-02-17T01:56:01.000Z"
updated: "2006-02-17T01:56:01.000Z"
replies: 0
views: 260
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/142608-problem-med-bakgrundsbild-i-ie"
---

# Problem med bakgrundsbild i IE

## #1 — rille77, 2006-02-17T01:56Z

Har stött på ett otroligt störande problem som jag hoppas att nån kan hjälpa mig med.

När jag lägger en background-image i en div så blir allt bara totalt fel i IE, i FX ser allt fint ut som vanligt.
När jag kör den med endast bakgrundsfärg så ser allt ut precis som det ska både i IE och FX.

Det som händer när man lägger in en bild är att det blir ett mellanrum i höjdled mellan de två "blocken" med divar.

Storleken på bilderna är korrekt är väl säkrast att tillägga.

Koden med endast bakgrundsfärg:

```
<body style="text-align:center;">
<div style="margin-left:auto; margin-right:auto; margin-top:10px; margin-bottom:10px; width:780px;">
  <div style="float:left; width:10px; height:10px; background-color:red;"></div>
  <div style="float:left; width:760px; height:10px; background-color:blue;"></div>
  <div style="float:left; width:10px; height:10px; background-color:green;"></div>
  
  <div style="float:left; width:10px; height:60px; background-color:red;"></div>
  <div style="float:left; width:160px; height:60px; background-color:blue;"></div>
  <div style="float:left; width:365px; height:60px; background-color:blue;"></div>
  <div style="float:left; width:235px; height:60px; background-color:blue;"></div>
  <div style="float:left; width:10px; height:60px; background-color:green;"></div>
</div>
</body>
```

 

Med bakgrundsbild istället:

```

<body style="text-align:center;">
<div style="margin-left:auto; margin-right:auto; margin-top:10px; margin-bottom:10px; width:780px; padding:0px;">
  <div style="float:left; width:10px; height:10px; background-image:url(images/index_07.jpg); background-repeat: no-repeat;"></div>
  <div style="float:left; width:760px; height:10px; background-image:url(images/index_08.jpg); background-repeat: repeat-x;"></div>
  <div style="float:left; width:10px; height:10px; background-image:url(images/index_09.jpg); background-repeat: no-repeat;"></div>
  
  <div style="float:left; width:10px; height:60px; background-image:url(images/index_12.jpg); background-repeat: no-repeat;"></div>
  <div style="float:left; width:160px; height:60px; background-image:url(images/logo_left.jpg); background-repeat: no-repeat;"></div>  
  <div style="float:left; width:365px; height:60px; background-image:url(images/logo_center.jpg); background-repeat: repeat-x;"></div>
  <div style="float:left; width:235px; height:60px; background-image:url(images/logo_right.jpg); background-repeat: no-repeat;"></div>
  <div style="float:left; width:10px; height:60px; background-image:url(images/index_14.jpg); background-repeat: no-repeat;"></div>
</div>
</body>
```

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

---

Tråden på webben: https://www.webforum.nu/amne/html-css/142608-problem-med-bakgrundsbild-i-ie
