Ir para conteúdo

POWERED BY:

Arquivado

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

Mvespa

Div não centra no Firefox

Recommended Posts

Olá Pessoal!

 

Aqui vai o meu primeiro post para este excelente forum que tenho visitado várias vezes mas só agora estou a colocar uma dúvida.

 

Estou a desenvolver um site com recurso a DIV's e está a funcionar tudo bem em Internet Explorer mas em Firefox não (que estranho, costuma ser ao contrário :) )

 

Aqui vai um printscreen do que se está a passar em Firefox:

 

Imagem Postada

 

Alguém sabe dar-me umas dicas sobre o que fazer neste caso>centrar a DIV no ecran

 

O CSS que estou a usar é este:

 

html { margin: 0px; padding: 0px; }body {	background: url(images/background.jpg) repeat-x;	background-color:Black;	margin: 0px; 	padding: 0px;	width:100%;	font: 11px Verdana,Arial,Helvetica,sans-serif;	text-align:center;}body{    text-align: -moz-center;    }.center{	background: url(images/backcenter.jpg);	background-color:Black;	background-repeat:no-repeat;	background-position:bottom;	}.divhome{	position:absolute;	height:480px;}.divtshirt {    position: absolute;    text-align:justify;     top: 20px;    left:-377px;}.divfotos {    position: absolute;    text-align:justify;     top: 238px;    left:-377px;}.divtopvendas {	position:absolute;	text-align:right; 	top:20px;	left:222px;}.divcenter{    position: absolute;    text-align:justify;         top: 20px;    left:-200px;    	}
e o HTML é este:

 

<html xmlns="http://www.w3.org/1999/xhtml" ><head><title>	REDANT</title><link href="styles.css" rel="stylesheet" type="text/css" />    <script type="text/javascript" src="flash.js"></script></head><body>    <form name="aspnetForm" method="post" action="home.aspx" id="aspnetForm"><div><input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKMTU1NjU3NDY4OWRkR3cqJKo0Gy27lCumjf3FpuU7KdI=" /></div><script type="text/javascript"><!--var theForm = document.forms['aspnetForm'];if (!theForm) {    theForm = document.aspnetForm;}function __doPostBack(eventTarget, eventArgument) {    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {        theForm.__EVENTTARGET.value = eventTarget;        theForm.__EVENTARGUMENT.value = eventArgument;        theForm.submit();    }}// --></script><script src="/redant/WebResource.axd?d=kuJdcXdIl8rhV6ERZYH5bg2&t=633028489299531250" type="text/javascript"></script>     <div id="divmaster">            <table style="width: 800px; height: 0px; vertical-align: top;" cellpadding="0" cellspacing="0" border="0" >                <tr>                    <td style="width: 800px; color: white; height: 19px;">                      <script language="javascript">                      new Flash("flash/top.swf", "Top", "800", "307", {wmode: "transparent", showMenu: "false"}).write();                      </script>                    </td>                 </tr>                 <tr>                    <td class="shopbar">                      <table width="100%">                       <tr>                        <td align="left">                                                            <a id="ctl00_LoginView1_HyperLink1" href="login.aspx" style="color:#E3E3E3;font-family:Verdana;font-size:10px;">Login</a> <span style="color:#e3e3e3">|</span> <a id="ctl00_LoginView1_HyperLink2" href="register.aspx" style="color:#E3E3E3;font-family:Verdana;font-size:10px;">Registo</a>                                                                    </td>                    <td>                            ssss                    </td>                    </tr>                    </table>                                            </td>                </tr>                <tr>                    <td class="center" style="width: 800px;height:480px; vertical-align:top;">                            <div class="divhome">    <div class="divtshirt">         <table width="155" border="0" cellpadding="0" cellspacing="0" >          <tr>            <td width="155" align="center" class="title" style="height: 19px;background-position:top;" background="ImageGen.ashx?image=red.png&width=155&height=38&red=true">                 <img id="ctl00_ContentPlaceHolder1_ImageDraw4"  src="http://localhost/redant/home.aspx?c=0ℑ=ctl00_ContentPlaceHolder1_ImageDraw4" style="border-width:0px;" /></td>          </tr>          <tr>            <td style="height: 150px;background-color:#e3e3e3;" class="text">                Cria a tua própria T-Shirt. Fotografia ou Borracha... a escolha é tua. Dá asas à tua imaginação<br /><br />                <img alt="" src="images/atreve.gif" />            </td>          </tr>          <tr>            <td style="height: 19px;background-position:bottom;" background="ImageGen.ashx?image=grey.png&width=155&height=38&red=false">                        </td>          </tr>        </table>    </div>        <div class="divfotos">          <table width="155" height="148" border="0" cellpadding="0" cellspacing="0" style="background-repeat:no-repeat;">          <tr>            <td width="155" align="center" class="title" style="height: 19px;background-position:top;" background="ImageGen.ashx?image=red.png&width=155&height=38&red=true">                 <img id="ctl00_ContentPlaceHolder1_ImageDraw1"  src="http://localhost/redant/home.aspx?c=0ℑ=ctl00_ContentPlaceHolder1_ImageDraw1" style="border-width:0px;" /></td>          </tr>          <tr>            <td style="height: 150px;background-color:#e3e3e3;" class="text">                Envia-nos uma foto divertida tua, dos teus amigos, onde apareçam os nossos produtos.As melhores fotos tem surpresas à tua espera...<br /><br />                <div style="text-align:center;"><a href="mailto:info@redant.pt"><img src="images/envia_foto.gif" alt="" /></a></div>            </td>          </tr>          <tr>            <td style="height: 19px;background-position:bottom;" background="ImageGen.ashx?image=grey.png&width=155&height=38&red=false">            </td>          </tr>        </table>    </div>              <div class="divtopvendas">    <table width="155" height="400" border="0" cellpadding="0" cellspacing="0" style="background-repeat:no-repeat;">          <tr>            <td align="center" class="title" style="height: 19px;background-position:top; width: 155px;" background="ImageGen.ashx?image=red.png&width=155&height=38&red=true">                 <img id="ctl00_ContentPlaceHolder1_ImageDraw2"  src="http://localhost/redant/home.aspx?c=0ℑ=ctl00_ContentPlaceHolder1_ImageDraw2" style="border-width:0px;" /></td>          </tr>          <tr>            <td style="height: 378px;background-color:#e3e3e3; width: 155px;" class="text">            </td>          </tr>          <tr>            <td style="height: 19px;background-position:bottom; width: 155px;" background="ImageGen.ashx?image=grey.png&width=155&height=38&red=false">            </td>          </tr>        </table>    </div>         <div class="divcenter">    <table width="400" border="0" cellpadding="0" cellspacing="0" style="background-repeat:no-repeat;">          <tr>            <td align="center" class="title" style="height: 19px;background-position:top; width: 155px;" background="ImageGen.ashx?image=red.png&width=400&height=38&red=true">                <img id="ctl00_ContentPlaceHolder1_ImageDraw3"  src="http://localhost/redant/home.aspx?image=ctl00_ContentPlaceHolder1_ImageDraw3" style="height:23px;width:205px;border-width:0px;" /></td>          </tr>          <tr>            <td height="360" colspan="3" bgcolor="#e3e3e3" class="text">        Uma variedade de produtos à sua escolha.<br />T-Shirt, LongSleeves, Top's, Sweat, Boxers, Tangas, Chapéus, Fitas, Malas, Canecas e muito mais...<br />Em apenas três passos tens um presente para um amigo, uma surpresa para a namorada ou então, simplesmente para ti.<br /><br />A baixos preços e de grande qualidade!<br /><br /><br /><br /><br /><br />            <div id=tshirt align="center"><img src="images/tshirts.jpg" border="0" /></div>        </td>          </tr>          <tr>            <td style="height: 19px;background-position:bottom; width: 155px;" background="ImageGen.ashx?image=grey.png&width=400&height=38&red=false">            </td>          </tr>        </table>    </div>    </div>                </td>                </tr>               <tr>               <td style="width: 801px">                   <img src="images/spacer.gif" height="10" />               </td>               </tr>                <tr>                    <td class="footer" style="width: 802px; height: 34px; background:url(images/footer.gif); background-repeat:no-repeat;">                        É uma marca registada. Qualquer cópia otu reprodução de imagens apresentadas neste site, é punida por lei. Em caso de querer representar a nossa marca, contacte-nos: <a href="mailto:info@redant.pt"><span class="linkfooter">info@redant.pt</span></a></td>                </tr>            </table>        </div>    <div>	<input type="hidden" name="__SCROLLPOSITIONX" id="__SCROLLPOSITIONX" value="0" />	<input type="hidden" name="__SCROLLPOSITIONY" id="__SCROLLPOSITIONY" value="0" />	<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />	<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" /></div><script type="text/javascript"><!--theForm.oldSubmit = theForm.submit;theForm.submit = WebForm_SaveScrollPositionSubmit;theForm.oldOnSubmit = theForm.onsubmit;theForm.onsubmit = WebForm_SaveScrollPositionOnSubmit;// --></script></form></body></html>

O que é que eu estarei a fazer mal, para não ficar centrado em Firefox?

Obrigado!

Compartilhar este post


Link para o post
Compartilhar em outros sites

Olá,

 

Você diz que é esse CSS que está a usar, então onde raio se encontra esta classe?

<td class="center" style="width: 800px;height:480px; vertical-align:top;">

É lamentável olhar para o resto do código :S, desculpe não consigo mesmo.

O uso de tabelas está completamente errada.

Quando tiver um tempo veja o material do nosso amigo Maujor .

 

Cumps [*]

Compartilhar este post


Link para o post
Compartilhar em outros sites

Tinha esquecido de colocar a class="center" já coloquei no sitio do CSSMuito obrigado pelos links bastante uteis, irei pesquisar e aprofundar de forma a poder solucionar esta questão.Obrigado pelas dicas! :)

Compartilhar este post


Link para o post
Compartilhar em outros sites

Olá,

 

E sê bem vindo :P, já vi que és do mesmo país que eu :D

 

Cumps [*]

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.