I want the .inputTitle on the left and inputInput on the right with an error between them.
What I always did was set the width for them.
For instance:
If you were supposed to have 3 elements with a floating point, and you want them to perfectly align in the "container" as such, for the container, of course, you need a set of widths.
After you set the width of the container, set the width of these three floating elements to the width of the container.
See below:
HTML:
<div class="container"> <div class="inputTitle"></div> <div class="inputError"></div> <div class="inputInput"></div> <div class="clear"></div> </div>
CSS
.container { width: 600px; } .inputTitle { width: 200px; float: left; } .inputError { width: 200px; float: left; } .inputInput { width: 200px; float: left; } .clear { clear: both; }
Ultimately, you could add the clear: both; CSS declaration in the container, but I would like to clearly indicate: both; Class just for safety.
Of course, you can always use Shortcuts, but setting a predefined width for the label through CSS will apply to all labels inside the class and / or id.
I hope this helps! Thank you Aaron
source share