Ir para conteúdo

Arquivado

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

danieldomi

WIDTH não funciona em FF

Recommended Posts

Olá pessoal, essa dúvida pode parecer meio tosca, mas não consegui resolver até agora...pq acontece do firefox ignorar o atributo "width = 150px"?no meu css, coloquei o seguinte:label {width: 150; text-align: right;}para que o texto da label de um campo ficasse com um tanho padrão e alinhado a direita... no IE funfa normal, mas no FF ele simplesmente ignora o tamanho estipulado... mesmo qdo coloco um "position: relative" nele e em todos os outros elementos, o FF ainda ignora.Tentei colocar direto na tag:<label for='campo' style='width: 150px; text-align: right'>UM CAMPO</campo> e ainda só funcionou para o IE ...Como poderia solucionar isso? Valeu pessoal!

Compartilhar este post


Link para o post
Compartilhar em outros sites

hehehe. esse problema aconteceu comigo a alguns posts atrás. É só pesquisar que você acha.A solução foi dada pelo pa_bruno. é só você colocar um float:left (ou float:right no seu caso) nos label que funcionará...

Compartilhar este post


Link para o post
Compartilhar em outros sites

hehehe. esse problema aconteceu comigo a alguns posts atrás. É só pesquisar que você acha.A solução foi dada pelo pa_bruno. é só você colocar um float:left (ou float:right no seu caso) nos label que funcionará...

Opa, valeu pela dica... li o seu tópico e de fato, se eu fizer isso:label {color:#222222; font-family:Arial; font-size:11px; font-weight:normal; width: 150; text-align: right; float:left; display:block;}... funciona.. mas mais ou menos... pois tenho o seguinte: label1: [CAMPO1] label2: [CAMPO2] label3: [ CAMPO3 ]no IE fica assim ... certinho, mas no FF, ele até ajusta o tamanho certo, mas o "label2" vai para na linha de baixo, como no exemplo a seguir: label1: [CAMPO1] [CAMPO2] label2: label3: [ CAMPO3 ]Ae continua bizarro... entende? Infelzmente não tenho como te mostar pq tudo está na intranet :/Vlw pela ajuda!

Compartilhar este post


Link para o post
Compartilhar em outros sites

Ummm, tenho que pensar um pouco...

 

Uai cara, pra mim aqui funfou beleza, veja:

<style>label {	border: 1px solid black; /* só pragente saber as dimensões dele */	width: 50px;}#pai { width:450px; border: 1px solid blue;}</style><body ><div id='pai'><label for='hou1'>NOme1:</label><input id='hou1' type='text'/><label for='hou2'>NOme2:</label><input id='hou2' type='text'/><label for='hou3'>NOme3:</label><input id='hou3' type='text'/><label for='hou4'>NOme4:</label><input id='hou4' type='text'/><label for='hou5'>NOme5:</label><input id='hou5' type='text'/></div></body>

Compartilhar este post


Link para o post
Compartilhar em outros sites

Cara... testei quase que exatamente o mesmo código que você enviou, só mudei o tamanho da label de 50px para 150px mas nada... tá punk o negócio ...o ff não colaborando.. ele não respeita o width definido...

ói o screen:

 

Firefox:

Imagem Postada

 

I.E.:

Imagem Postada

 

Não tá dando certo... desse jeito vou apelar pros tables que sei que funfam hehehehe =)

Compartilhar este post


Link para o post
Compartilhar em outros sites

Puts cara, realmente.Falha nossa. Vou pensar numa solução pra postar aqui.Vê se você consegue algo também...

Compartilhar este post


Link para o post
Compartilhar em outros sites

è .. hehehe complicado esse esquema... vou ver se acho alguma coisa....vlw ae de qq forma! =)

Puts cara, realmente.Falha nossa. Vou pensar numa solução pra postar aqui.Vê se você consegue algo também...

Compartilhar este post


Link para o post
Compartilhar em outros sites

olá,eu não vi os tópicos pois não estou com tempo nesse momento, mas pelo que entendi você está fazendo um label com width:150px e no ieca funciona mas no ff ele fica do tamanho do texto certo? ta mas se for isso, tenta forçar o tamanho dele utilizando padding-left:75px; padding-right:75px; não sei se vai resolver mas testa ai, falow...

Compartilhar este post


Link para o post
Compartilhar em outros sites

Testei aqui, grafitero, funcionou mas não é útil pois dependerá do texto que estiver dentro do label.danieldomi:Vamos jogar mais na realidade: Quantos campos voce quer por linha?

Compartilhar este post


Link para o post
Compartilhar em outros sites

Ae micox, preciso entre 1 a 2 campos por linha, como nas figuras a seguir:

 

Assim é o que deveria ficar (screen do IE):

Imagem Postada

 

mas aparece assim no FF (screen do Firefox):

Imagem Postada

 

 

to quebrando a cabeça com isso :/ ... agradeço ae seu apoio micox

 

o fonte disso aqui é:

<HTML><HEAD><STYLE>BODY {background: #F5F5F5 center no-repeat fixed; scrollbar-3dlight-color:#CCCCCC; scrollbar-arrow-color:#00903D; scrollbar-backgorund-color:#FFFFFF; scrollbar-darkshadow-color:#CCCCCC; scrollbar-face-color:#F5F5F5; scrollbar-highlight-color:#FFFFFF; scrollbar-shadow-color:#FFFFFF; margin-right: 0px; margin-left: 0px; margin-top: 0px; margin-bottom: 0px;}H1 {color:#00903D; font-size:15px; font-weight:bold; text-decoration:none; display: inline;}FIELDSET {color:#222222; font-family:Arial; font-size:11px; font-weight:bold; width: 750px;}LABEL {color:#222222; font-family:Arial; font-size:11px; font-weight:normal; width: 125px; text-align: right;}.formSelect	{font-family: Arial; font-size: 11px; color: #505050; font-weight:normal;}.formText	  {font-family: Arial; font-size: 11px; color: #505050; border: #CCCCCC; border-style: none; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; margin-top: 1px; BORDER-RIGHT: #CCCCCC 1px solid; BORDER-TOP: #CCCCCC 1px solid; BORDER-LEFT: #CCCCCC 1px solid; BORDER-BOTTOM: #CCCCCC 1px solid; font-weight:normal;}.formInvalText {font-family: Arial; font-size: 11px; color: #505050; background-color: #FFE5E5; border: #CC0000; border-style: none; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; margin-top: 1px; BORDER-RIGHT: #CC0000 1px solid; BORDER-TOP: #CC0000 1px solid; BORDER-LEFT: #CC0000 1px solid; BORDER-BOTTOM: #CC0000 1px solid; font-weight:bold;}.formButton	{font-family: Arial; font-size: 11px; color: #505050; cursor: pointer; background-color: #F5F5F5; font-size: 11px; font-weight: bold; border: #CCCCCC; border-style: none; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; margin-top: 1px; BORDER-RIGHT: #CCCCCC 1px solid; BORDER-TOP: #CCCCCC 1px solid; BORDER-LEFT: #CCCCCC 1px solid; BORDER-BOTTOM: #CCCCCC 1px solid;}</STYLE></HEAD><BODY><div style='width: 100%; height: 100%; top: 0px; left: 0px'><form action='index.php' method='post' name='formLogin' target='_parent'><fieldset><legend >Informações Básicas</legend><div id='row1'><label for='main_nome' >Nome:  </label><input type='text' name='main_nome' id='main_nome' class='formText' style=' width: 250;' value='' maxlength='200' readonly ><label for='main_tipo' >Tipo:  </label><select name='main_tipo' id='main_tipo' class='formSelect' style=' width: 150;' disabled >  <option value='PF' >Pessoa Física</option>  <option value='PJ' selected>Pessoa Jurídica</option></select></div><br /><div id='row2'><label for='main_fone' >Telefone:  </label><input type='text' name='main_fone' id='main_fone' class='formText' style=' width: 150;' value='' maxlength='10' readonly ><label for='main_fone_alternativo'  style=' width: 225;'>Tel. Opcional:  </label><input type='text' name='main_fone_alternativo' id='main_fone_alternativo' class='formText' style=' width: 150;' value='' maxlength='10' readonly ></div><br /><div id='row3'><label for='main_email' >E-mail:  </label><input type='text' name='main_email' id='main_email' class='formText' style=' width: 250;' value='' maxlength='250' readonly ></div><br /><div id='row4'><label for='main_situacao' >Situação:  </label><select name='main_situacao' id='main_situacao' class='formSelect' style=' width: 250;' disabled >  <option value='Classificado' >Classificado</option>  <option value='Não classificado' >Não classificado</option>  <option value='Validado' >Validado</option>  <option value='Não Validado' selected>Não Validado</option>  <option value='Cancelado' >Cancelado</option></select><label for='main_ultima_atualizacao' >Atualizado em:  </label><input type='text' name='main_ultima_atualizacao' id='main_ultima_atualizacao' class='formText' style=' width: 150;' value='28/03/2006 10:30:52' readonly ><input type='hidden' name='main_cod_mailing' id='main_cod_mailing' style='' value='2' ></div><br /></fieldset></form></div></BODY></HTML>

Vlw

 

Testei aqui, grafitero, funcionou mas não é útil pois dependerá do texto que estiver dentro do label.

 

danieldomi:

Vamos jogar mais na realidade: Quantos campos voce quer por linha?

Compartilhar este post


Link para o post
Compartilhar em outros sites

Ops... falha nossa. Se você colocar o float:left TAMBÉM no input, você vai conseguir o que quer. Olha só um exemplo que eu fiz:

 

<style>fieldset { width: 600px;}fieldset label { width: 70px; float:left;}fieldset input { width: 100px; float:left; }</style><fieldset><legend>Legenda</legend><label for='nome'>Nome:</label><input type='text' id='nome' value='nome'/><label for='email'>Email:</label><input type='text' id='email' value='mail' /><label for='cidade'>Cidade:</label><input type='text' id='cidade' value='cidade' /><label for='bairro'>BAirro:</label><input type='text' id='bairro' value='bairro' /></fieldset>

Compartilhar este post


Link para o post
Compartilhar em outros sites
AEEEEEEEEEEEEEEEEEEE!!!!é bem isso! .. só precisei dar uns <br /> para separar as linhas ;)Brigadão bro! Valeu pelo toque1Até mais!

Ops... falha nossa. Se você colocar o float:left TAMBÉM no input, você vai conseguir o que quer. Olha só um exemplo que eu fiz:

<style>fieldset { width: 600px;}fieldset label { width: 70px; float:left;}fieldset input { width: 100px; float:left; }</style><fieldset><legend>Legenda</legend><label for='nome'>Nome:</label><input type='text' id='nome' value='nome'/><label for='email'>Email:</label><input type='text' id='email' value='mail' /><label for='cidade'>Cidade:</label><input type='text' id='cidade' value='cidade' /><label for='bairro'>BAirro:</label><input type='text' id='bairro' value='bairro' /></fieldset>

Compartilhar este post


Link para o post
Compartilhar em outros sites

Bão dimais. heheheTags pra pesquisa: label largura width não funciona fieldset campos sem tabelas formulário

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.