Diginate
Diginate

Reputation: 17

Floating divs not floating correctly

This is my first post here and as I am at my wits end so thought I'd jump in and finally ask for some help!

I have a "Contact us" section on a website I'm designing containing a small about us paragraph, email and phone. Next to it there is an email contact form that I got from php form builder. Everything was going swimmingly until I dropped that bad boy in.

Anywho here's my code for the Contact Us 'wrapper':

#contact {
 background-image:url(img/contact_bg.jpg);
 background-repeat: no-repeat;
 width: 820px;
 height: 459px;
 margin: 25px 70px 50px 70px;
 clear: both;
 }

#thanks {
 width: 324px;
 height: 100px;
 padding-top: 35px;
 }

#thanks span {
  font-size: 1.5em;
  font-weight: normal;
  font-style: italic;
  letter-spacing:1px;
  color: #ffffff;
  text-shadow: 1px 1px 1px #000000;
  text-decoration: none;
  padding: 0 0 0 25px;
 }

#details {
 width: 324px;
 height: 63px;
 padding-top: 25px;
 clear: both;
  }

#details span {
 font-size: 1.115em;
 font-weight: normal;
 font-style: italic;
 letter-spacing:1px;
 color: #ffffff;
 text-shadow: 1px 1px 1px #000000;
 text-decoration: none;
 padding: 0 0 0 25px;
 clear: both;
 }

#about {
 width: 324px;
 clear: both;
 }

#about h2 {
 font-size: 1.618em;
 font-weight: normal;
 letter-spacing:1px;
 color: #ffffff;
 text-shadow: 1px 1px 1px #000000;
 padding-left: 25px;
 text-decoration: none;
 clear: both;
 }

#about span {
 font-size: 1em;
 font-weight: normal;
 letter-spacing:1px;
 color: #ffffff;
 text-shadow: 1px 1px 1px #000000;
 line-height: 14px;
 text-decoration: none;
 padding: 10px 0 0 25px;
 clear: both;
 }

and here is my form css:

  #form {
   margin:0 auto;
   text-align:left;
   width:391px;
   height: 459px;
   float: right;
   }

  form.appnitro {
   margin:20px 20px 0;
   padding:0 0 20px;
   }

Here are some screenshots:

This is what it's supposed to look like: expected This is what its looking like now :( actual

Any help is greatly appreciated, if you require any more info please let me know.

Many thanks!

Upvotes: 1

Views: 438

Answers (2)

adamhuxtable
adamhuxtable

Reputation: 479

All you need to do is put another div around the left hand content and float it left, like so

<div style="float:left">
    <div id="thanks">
        <span>Thank you for your interest in Dan James construction. Please contact us using a method convenient for you.</span>
    </div>

    <div id="details">
        <span>Tel: 07749 121959</span>
        <span>Email: [email protected]</span>
    </div>

    <div id="about">
        <h2>ABOUT US</h2>
        <span>Dan James construction are specialists in loft 
conversion based in North London and covering the whole of the M25 area.</span><span>We guide you through every stage of your 
development journey, right from the no obligation FREE estimate to the fine finishing touches.</span><span>So whether you're looking for more space or looking to add value get in touch today to start your very own conversion</span>
    </div>

</div>

That should work let me know how it goes ;-)

Upvotes: 0

idrumgood
idrumgood

Reputation: 4924

Your #thanks nor your #about are floated so your contact form, though floated, is appearing under them. You need to float both #thanks and #about float:left.

You also have a lot of clear:both which will reset the document flow probably causing some of the issues you're seeing. It's hard to say without seeing the actual HTML though.

Upvotes: 1

Related Questions