The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › CSS › CSS alignment without using tables
Im trying to align some text and a field using CSS only
I tried everything (and the vertical-align:middle does nothing)
Any ideas would be helpful :)
Just use the html form element instead. Something like
First name: <input type=”text” name=”FirstName”><br>
Last name: <input type=”text” name=”LastName”><br>
<input type=”submit” value=”Submit”>
vertical-align doesn’t work on floated elements…nor should float be used as the same time as display:inline…they’re mutually exclusive.
If you remove the float and use display:inline-block then vertical-align works.
Re: the previous post, it’s considered bad practice to use br tags for spacing…that’s what margins and padding are for.
Thanks Paulie_D – that was an easy and effective fix!!
I didnt know about inline-block :-)