label1, input textbox1 and label2 so far are perfectly positioned exactly how I want it to be, but when I created the style for input textbox2, it moves the position of input textbox1
They've even got id's to differentiate between input textbox1 and input textbox2so why is it repositioning input textbox1?
Any ideas? solutions, corrections of styles much appreciated
form input{
width:200px;
height:18px;
float:left;
clear:none;
}
/* class for submit button */
form input.btn{
width:70px;
height:35px;
margin:5px 0 0;
padding:0 10px;
line-height:32px;
text-align:center;
}
if you are using check boxes and radio buttons you can define the following CSS classes
form input.checkbox, form input.radio{
width:15px;
height:15px;
float:left;
clear:none;
margin:5px 10px 0 0;
padding:0;
}
It's best to create an external form.css stylesheet will all the above styles you can reuse in pretty much all your web design projects.
If you want to position the label above its corresponding field, then you can just add the following CSS rules:
clear:both;
text-align:left; /* to flush the text label to the left */
You could also choose to not float both label and field.
In that case just use the following CSS rule:
float:none;
Bookmarks