Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

goncalves2345

problema com div no IE7

Recommended Posts

E aí tudo bem?

 

Eu estou tendo problema com o internet explorer 7 a propriedade margin que eu coloquei na minha #div tudo pra dar uma distância entre topo e o radapé da borda eu acho que isso não sei explicar direito: margin:1em auto; /* 1em = 10px */ nos outros navageadores que eu testei estar funcionando(firefox,opera, google chrome) só não no IE7, que só funciona no topo, mas no rodapé ele fica colado. Espero que vocês possam ter entendido a minha dúvida.

 

Segue o código, espero que vocês possam me ajudar desde de já eu agradeço pela atenção.

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<title>Exemplo Page</title>

<style type="text/css">

.{ 
margin: 0; 
adding: 0; 
background-image: none; 
text-align:center; /* hack para o IE */  
} 
/* Zerando as margens e preenchimentos de todas as tags */
body { 
margin:0; 
padding:0; 
background:#ccc; 
background-color:#CCCCCC; 
text-align:center; /* hack para o IE */ 
} 
#tudo { 
background-color: #FFFFFF; 
width: 760px; 
margin:1em auto; /* 1em = 10px */ 
border:#999 solid 1px;  
text-align:left; /* "remédio" para o hack do IE */   
} 
#conteudo { 
padding: 5px; 
background-color: #FFFFFF; 
font: 12px "Verdana", Helvetica, sans-serif; 
color:#000000;
text-align:center;
} 
#topo { 
background-color: #800000; /* definido cor de background para o topo */ 
height: 150px; /* definindo altura de 150px */ 
width:100%;
text-align:center;
color:#FFFFFF; 
}
#rodape { 
background-color: #800000; /* definido cor de background */ 
height: 40px; /* definindo altura de 40px */ 
text-align:center;
color:#FFFFFF; 
font: 14px "Verdana", Helvetica, sans-serif; 
clear: both;  /* não permitindo que objetos "flutuantes" obstruam o rodapé. */
}

#imagem_index {
position:relative; 
width:550px; 
height:300px; 
z-index:3; 
left: 30px; 
top: 60px; 
text-align:center; 
background-image:url(imgs/tunados.jpg); 
}
#texto_index { 
position:relative; 
width:589px; 
height:70px; 
z-index:1; 
margin-left:30px; 
margin-top: 20px; 
text-align:center; 
color:#666666; 
font: 14px "Verdana", Helvetica, sans-serif;
}
</style>

</head>
<body>
<div id="tudo"> 
   <div id="topo">
TOPO
</div><!--fim div topo-->
	<div id="conteudo">
	<div id="imagem_index"> </div>
		  <p> </p>
		  <p> </p>
		  <div id="texto_index">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</div>	
	<p> </p>
    <p> </p>
	</div><!--fim div conteúdo-->
	<div id="rodape">Rodapé</div><!--fim div rodapé-->
</div><!--fim div tudo-->
</body>
</html>

Compartilhar este post


Link para o post
Compartilhar em outros sites

Creio que 1em não seja igual a 10 px.

 

1em is equal to the current font size. 2em means 2 times the size of the current font. E.g., if an element is displayed with a font of 12 pt, then '2em' is 24 pt. The 'em' is a very useful unit in CSS, since it can adapt automatically to the font that the reader uses

 

Já tive problemas com IE e outros navegadores simplesmente por causa do em. Para o caso de margem cara, aconselho usar px mesmo ou cm.

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.