I am new to CSS, so please bear with me. I have this form which I’m trying to style. Everything works fine, except the confirmation label which is in a div. I want some space to be there between div.field, and while this works for all the input elements, it doesn’t work for the label message which is at the bottom. I tried increasing margin-top, but to no avail. I would like that element to be positioned in the center.
Using the web-developer addon of Firefox, it shows me that the width and height of div.field of label tag specifically is 284px and 209px respectively. Why is this so, when I haven’t set it that way?
You can view the code live at jsfiddle: http://www.jsfiddle.net/yMHJY/
The solution is simple, really. Add a margin-top to the parent of the
labelelement, and addoverflow: hiddento thediv#contact div .fieldselector.However, can I just say that the code can be rewritten for much better efficiency and semantic correctness. For instance, I would contain the last massage in a
ptag and not alabelin adiv. Also, I would have eachinputelement placed in an unordered listulinstead ofdivs. You also have a lot of unnecessaryfloats and thebrat the end of eachinputis wholly uneeded. Oh, and unless you are embedding Calluna somehow, don’t use it – stick to web safe fonts (and if you are, you still need to suggest an alternative, in the user’s browser does not support it, and also to give the browser something to display while the font loads).Edit
Fixed the load for ya, I should be paid for this kind of stuff 🙂 Just stick to better HTML and CSS next time.
http://www.jsfiddle.net/SNrtA/