http://anonoz.com/armesh//contact_form/
The above link shows a contact form that I am making.
I am trying to make it like the picture in the right. I have to give the text "Try us Today" a margin-top
of 20px.
HTML:
<body>
<div id="form_container">
<div id="form_body">
**<span class="form_head">Try us Today</span>**
<br/>
<span class="form_subhead">30 day money back gurantee</span>
<form id="enquiry_form" method="post" action="scripts/contact-form-handler.php">
<input type="text" name="name" id="name" value="Name" />
<input type="text" name="contact" id="contact" value="Contact Number" />
<input type="text" name="e-mail" id="email" value="Email" />
<input id='submit_button' type="submit" value="Get Your Space - NOW" />
</form>
</div>
</div>
<img src="form2.jpg"/>
</body>
CSS:
.form_head {
margin-top: 20px;
color:#58585a;
font-size:22px;
}
The CSS should have pushed the .form_head
20px down against the #form_body
div. However nothing happened. I even experimented with Firebug and Chrome developer tools but didn't get a clue why is this happening. I also tried setting the height of #form_body
div to match the form's height so there is room for the .form_head to be pushed down but it's still not working.
I've been been coding for 3 months now and I often face this type of problem. I always hack my way out by simply keying in some positioning codes to get it done.
However, I don't want do the same today, but want to understand why is this happening and how to solve it the proper way. Could someone please shed some light and educate me on this?