I have following HTML output which i can not change. I want to specify the width and the text-align to right for the label text (ie. Name), but because i can not change the output, I am unable to do that. Is it still possible to do that without changing HTML?
<label>Name:<br><input type="text" value="" name="name"></label>
PS. I want to display label text and input field in same row, so I have set float: left for the <br>.
Just setting
BRtodisplay: none;should make everything appear on the same line. You can set the text alignment on theinputtag withtext-align: rightas well:http://jsfiddle.net/kkgbV/1/
You can also make
labela block element, andinputfloat to the right:http://jsfiddle.net/kkgbV/4/