Jump to content


Photo

Centralizar


  • Faça o login para participar
1 reply to this topic

#1 Thais Baio

Thais Baio

    12 Horas

  • Usuários
  • 150 posts
  • Sexo:Feminino

Posted 08/10/2009, 16:04

vejam esse código:

<style type="text/css"> 
#testegeral {width:100%;text-align:center;height:800px;background:#FF6600;}
#teste {width:90%;margin:0auto;height:600px;background:#999999;}
#prod1,#prod2,#prod3 {width:50px;height:50px;background:#FFFF00;margin:20px;float:left;}
#prod1{width:150px;height:150px;float:left;}
#prod2 {width:150px;height:150px;float:left;}
#prod3 {width:150px;height:150px;float:left;}
</style>

<div id="testegeral"> 
	<div id="teste"> 
	  <div id="prod1"> 
	
	</div>
	
	<div id="prod2"> 
	
	</div>
	
	<div id="prod3"> 
	
	</div>
	  
  </div>
</div>

Preciso centralizar o cinza em relação ao laranja e os quadrados amarelos em relação ao cinza...Alguem sabe como conseguir?

obs: as medidas devem ser em porcentagem...ferrou-se ne?

alguem sabe uma solução para isso?

desde ja mto obrigado =)

#2 Sharths

Sharths

    Novato no fórum

  • Usuários
  • 6 posts
  • Sexo:Não informado

Posted 08/10/2009, 16:29

ve se isso resolve, só testei no IE, acho que era isso que você queria
<style type="text/css"> 
#testegeral {width:100%;text-align:center;height:800px;background:#FF6600;}
#teste {width:90%;margin:auto;height:600px;background:#999999;}
#prod1,#prod2,#prod3 {width:50px;height:50px;background:#FFFF00;margin:20px;}
#prod1{width:150px;height:150px;}
#prod2 {width:150px;height:150px;}
#prod3 {width:150px;height:150px;}</style>

<table id="testegeral">
<tr>
<td>
	<table id="teste">
	<tr>
<td align="center">

		<div id="prod1">
		</div>
		</td>
		<td align="center">
		<div id="prod2"> 
		</div>
		</td>
		<td align="center">
		<div id="prod3">
		</div>
		</td>
		</div>

			</td>
		</tr>

		</td>
		</tr>
		</table>

Edição feita por: Sharths, 08/10/2009, 16:30.





1 user(s) are reading this topic

0 membro(s), 1 visitante(s) e 0 membros anônimo(s)

IPB Skin By Virteq