CSS float and width properties problem in IE and Firefox?





Coupon Codes, Rebates & Free Shipping Codes
PCmover - $15 Off with Coupon Code S6ch2
muvee Reveal takes your photos, video and music
and automatically creates your own highly polished
personal muvee.
Visit the Nuance store today
Download a Free Trial of Acronis True Image 2009
Visit the CA US Store!
10% Off - 1 YR - Trend Micro Internet
Security 2009 - Coupon Code: TrendIS.

Get 10% off any purchase at MacSpeech.com
when you use the coupon code DICTATE10!
Get PowerDirector 7 Ultra from Cyberlink - optimized
for Intel Core i7

Hi,

when the following page:

http://www.geocities.com/iamsupersupersu...

is viewed in IE, you can see that the two textboxes are horizontally aligned correctly this is because I have set the widths of the labels to 80px by using CSS. However, when this page is viewed in firefox, the two textboxes are no longer horizontally aligned correctly.

I can't understand why firefox doesn't seem to be aware of the widths that are set to the labels.

But if I add another CSS property float: left to the labels, so it altogether becomes:

label{width: 80px;float: left;}

You can view it here:

http://www.geocities.com/iamsupersupersu...

then both IE and firefox can display the page correctly.

could somebody plz explain this weird behavior and why the float: left property is required in firefox but not in IE?

Thank you very much for your help.

CSS float and width properties problem in IE and Firefox?safari browser

The <label> tag is an compact box that behaves as an inline tag (it has no width and ignores the width property). Imagine, for example setting the width on an inline tag such as <b> - this would be meaningless.

Using a float:left forces a compact box to behave as a block (like <p> or <div> tags) - which now pays attention to the width property.

A more complete explanation can be found at http://www.w3.org/TR/REC-CSS2/visuren.ht...



More Related Questions and Answers ...
  • Issuses with ie 5.5?
  • Java and IE 6elp plz?
  • Problem with ie?
  • How to restore my ie icon?
  • Text Alignment Issues in IE -- Fine in Firefo..
  • Can&#039;t reset my IE Homepage!?
  • Why does IE shut down when I click on my Yaho..
  • I got ie defender on my computer?
  • Pleas Help !!! IE 7 new version made my compu..
  • CSS & background-image in IE, Firefox, Ne..
  • Flash Content Disappears on IE 6, why?
  • Publisher webpage shifts in IE?
  • Please try this website using both browsers :..
  • Why is this not displaying correctly in IE? I..
  • What&#039;s the problem with IE?
  • Html FRAMES - looks fine on IE - but the fram..
  • How do i get a "IE" only site to wo..
  • DIV not working prob. in IE?
  • Theres something wrong with my ie on windows ..

  • The information post by website user , we not guarantee correctness.