I have the following CSS:
label{
float:left;
margin-left:24px;
}
button{
margin-left:24px;
}
for this HTML:
<label>
<input>
</label>
<button>
and I was hoping that the button was found at a distance of 24 pixels of the label, however this did not happen until I floated the button to the left too. What part of the CSS specification I can refer to understand why this happening?
(Please, sorry my English.)
Sorry for my previous answer which I hope was deleted.
Margins are tricky. In this case, margins don’t count against floats: they are computed from the place where the element would start if the float wasn’t there. Possibly you can apply a margin-right to the float, or if you know the float’s width add that plus its margin to the value you want to separate them.