ThePsion5 Posted February 15, 2008 Share Posted February 15, 2008 Hi,I'm creating a form and I want to set the width of all labels for that form. I assumed that the CSS for this would be quite simple: label{width: 250px;} But this code doesn't work at all - at least not in the latest version of Firefox. Any ideas what I may be doing wrong and the proper way to go about this? Thanks! Link to comment Share on other sites More sharing options...
jeffman Posted February 15, 2008 Share Posted February 15, 2008 Add this to your css:display: block;I'm really not sure what side effects that might cause, but give it a try. Link to comment Share on other sites More sharing options...
ThePsion5 Posted February 15, 2008 Author Share Posted February 15, 2008 Add this to your css:display: block;I'm really not sure what side effects that might cause, but give it a try.I could do that, but the form I'm creating has the labels on the left side and the input elements on the right side. Here's a sample of the HTML:<label for="first_name">First Name</label><input type="text" id="first_name" /><br /><label for="last_name">Last Name</label><input type="text" id="first_name" /><br /><label for="address1">Address</label><input type="text" id="address1" /> The idea behind my CSS is that I can have the labels be the same width so the form input elements are all aligned from the left side (without using any form of tables). Any ideas? Link to comment Share on other sites More sharing options...
newseed Posted February 15, 2008 Share Posted February 15, 2008 Add float: left; Link to comment Share on other sites More sharing options...
jeffman Posted February 15, 2008 Share Posted February 15, 2008 Have you tried some sort of positioning technique? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.