http://anonoz.com/armesh//contact_form/
The link above shows the contact form I am doing. I am trying to do this as the picture on the right. I have to give the text "Try it 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; }
CSS was supposed to push .form_head 20px to the #form_body div. However, nothing happened. I even experimented with the Firebug and Chrome developer tools, but didn't understand why this was happening. I also tried setting the height of the #form_body div to fit the height of the form, so there is room for formatting .form_head, but it still doesn't work.
I have been coding for 3 months, and I often encounter this type of problem. I always work my way out just by inserting some positioning codes to do this.
However, I do not want to do the same today, but I want to understand why this is happening and how to solve it properly. Can someone shed light and enlighten me on this?
Armesh singh
source share