I'm styling a form designed by a client with the following structure:
<div class="formRow">
<div class="fieldName">
Email
</div>
<div class="fieldInput">
<input .../>
</div>
</div>
The width of the form is 500px, but the fieldName div and the fieldInput div stack on top of each other instead of sitting side-by-side. This is because (at least in Chrome and Firefox), the fieldName div is getting a computed right-margin of 340px, taking up the entire width of the form.
I can't seem to override this behavior, either. Entering a margin-right of 10px does nothing. And setting the width of the div either to a hard number or a percentage only changes the inside width, not the strange right-margin.
What CSS headache am I running up against, here?
BTW, here's the CSS:
.formRow{
padding: 3px 0 3px 0;
position: relative;
height: auto;
width: 100%;
}
.fieldName{
font-size: 12px;
margin-left: 10px;
margin-right: 10px;
width: 100px;
}
.fieldInput{
width: 200px;
}