OsakaWebbie
Programmer
I'm trying to use CSS spans to keep form field labels with their respective fields while allowing wrapping between the label-field sets as needed. In Firefox it works fine to have something like this (simplifying - the actual CSS is external):
But in IE and Chrome (I haven't tested Safari or Opera), simple whitespace between the spans is not enough to allow wrapping, and even a space at the end of the line, the CR, and then more spaces (which are normally there for indenting anyway) is not enough. The only combination I have found to work in IE and Chrome is:
I don't really want to put that in there, because it forces two spaces (the regular one and the non-breaking one) in all cases, rather than allowing CSS to dictate the size of the space between. Plus, it's just weird to have that. Any thoughts on a more elegant method that works in all modern browsers?
Code:
<span style="white-space:nowrap"><label for "somefield">Field: </label><input name="somefield" ... /></span>
<span style="white-space:nowrap"><label for "someotherfield">Other Field: </label><input name="someotherfield" ... /></span>
Code:
...</span>
<span ...