Skip navigation
Currently Being Moderated

Can't (for some reason) to get a div to float left

Aug 16, 2012 8:10 PM

It's not like I haven't done it before, but somehow I can't get a couple of divs to float left. I have an ugly website at and I'm trying to get a pair of links at the very bottom to float next to each other but they're fighting me, or vice-versa.


Everything passed the verifier, so I know it's not some sort of weird conflict.



  • Currently Being Moderated
    Aug 16, 2012 8:26 PM   in reply to Acemon99

    I am seeing this in FF14 (click on it to magnify it):




    Is this what you are talking about?  If so what is wrong with it and how do you want them to look.

    Mark as:
  • Currently Being Moderated
    Aug 17, 2012 5:00 AM   in reply to Acemon99

    I see the same.  I notice you have set up a footer DIV which is empty, did you intend these links to be in it?

    Mark as:
  • Currently Being Moderated
    Aug 17, 2012 5:46 AM   in reply to Acemon99

    Mathematical oversight.


    Your fh1a <div> is 600px wide. As you have set margin-left: 5px; on the .also css selector that makes the total sum of the two <divs> 610px wide. (margin and padding get added to the width). That's why the <divs> are not next to each other.


    Either zero out the left margin as below or get rid of it as its not required if the margin is set to zero or if you do require a margin make the width of the <divs> 295px wide instead of 300px.




    .also {

        float: left;

        width: 300px;

        height: 30px;

        margin-left: 0px;

        margin-top: 5px;

        text-align: center;


    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points