← HTML + CSS

IE7 => Div vazio com imagem de BG via CSS

Lida 5286 vezes

Offline

muiomuio 
Membro
Mensagens 324 Gostos 0
Feedback +1

Troféus totais: 23
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Poll Voter Level 4 Level 3 Level 2 Level 1 100 Posts 50 Posts

Código:

Código: [Seleccione]
<div class="sectionBreak"></div>
Já tentei das seguintes formas:

Código: [Seleccione]
<div class="sectionBreak"><span></span></div>
Código: [Seleccione]
<div class="sectionBreak">&nbsp;</div>
Código: [Seleccione]
<div class="sectionBreak"><span>&nbsp;</span></div>
Código: [Seleccione]
<div class="sectionBreak"><!-- --></div>
No css já apliquei padding, width, line-height, min-height, height, display block. Mas no IE 7 continua a não mostrar a imagem de background.

De resto funciona em IE8, IE9, FF, Chrome, Safari...

Alguém sabe como resolver isto?
Offline

bfms 
Equipa
Mensagens 1769 Gostos 40
Feedback +1

Troféus totais: 35
Trófeus: (Ver todos)
Search Level 6 Apple User Super Combination Combination Topic Starter 50 Poll Votes 10 Poll Votes Poll Voter Poll Starter

Define a altura dessa div (caso tenha altura fixa) e experimenta no CSS colocar:

Código: [Seleccione]
overflow: hidden;
Offline

muiomuio 
Membro
Mensagens 324 Gostos 0
Feedback +1

Troféus totais: 23
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Poll Voter Level 4 Level 3 Level 2 Level 1 100 Posts 50 Posts

Suspeitei que fosse do hasLayout, já tinha testado com o zoom:1 mas não tinha funcionado.

Thanks.
Offline

ricardomoreira 
Membro
Mensagens 69 Gostos 0
Troféus totais: 19
Trófeus: (Ver todos)
Windows User Apple User Super Combination Combination Topic Starter Level 3 Level 2 Level 1 50 Posts 10 Posts

Código:

Código: [Seleccione]
<div class="sectionBreak"></div>
Já tentei das seguintes formas:

Código: [Seleccione]
<div class="sectionBreak"><span></span></div>
Código: [Seleccione]
<div class="sectionBreak">&nbsp;</div>
Código: [Seleccione]
<div class="sectionBreak"><span>&nbsp;</span></div>
Código: [Seleccione]
<div class="sectionBreak"><!-- --></div>
No css já apliquei padding, width, line-height, min-height, height, display block. Mas no IE 7 continua a não mostrar a imagem de background.

De resto funciona em IE8, IE9, FF, Chrome, Safari...

Alguém sabe como resolver isto?

Mostra o CSS, pois assim é difícil ajudar.
Offline

muiomuio 
Membro
Mensagens 324 Gostos 0
Feedback +1

Troféus totais: 23
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Poll Voter Level 4 Level 3 Level 2 Level 1 100 Posts 50 Posts

Apesar de já estar resolvido mostro o css que tinha:

Código: [Seleccione]
.sectionBreak {
height:50px;
width:100%
float:left;
background:url('../imgs/frontend/sectionBreak.jpg') left top repeat-x;
}

Eventualmente adicionei o overflow hidden e funcionou.

Código: [Seleccione]
.sectionBreak {
height:50px;
width:100%
float:left;
background:url('../imgs/frontend/sectionBreak.jpg') left top repeat-x;
overflow:hidden;
}