CSS – label control ignores the width style

Author posted by Jitendra on Posted on under category Categories HTML, Tech Tips and tagged as Tags with Leave a comment on CSS – label control ignores the width style

CSS – label control ignores the width attribute in style

Label tag does not work with css attribute “width” on some browsers like Chrome and Mozilla.

Simplest solution is :
before applying css for width, make sure “float:left” is written for label control.

Label elements are in-line style elements, so technically Chrome and Firefox are interpreting the CSS properly by not obeying my width declaration. In-line elements do not accept width attributes. The workaround is to force the label element to become a block level element by floating it.

 

Related posts