Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Float Problem

Status
Not open for further replies.

audiopro

Programmer
Apr 1, 2004
3,165
GB
I am tryimg to position a number of divs, above one another, in a container. They are all floated to the right The bottom 2 divs are less than half the container width and are displaying out of order.
Instead of
Code:
1
 2
  3
   4
I get
Code:
1
 2
 43
I could pack each of them with a div before it but there must be a prettier way.

Keith
 
The last two were in the same line because they fit in the same line. The question is, do you have to float them? It does not really look like float is what you're looking for. Maybe margin-left: auto; would be more up your alley.
 
I Agree with Vrag, if you want them one under the other, then why are you Floating them at all?

Margin or padding may be what you are looking for.

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Thanks guys
It sort of evolved that way with the floats as the format of the page has had to be changed numerous times and hence the problem. I couldn't understand why a div would be placed out of sequence but I am still learning. I hadn't realised that as they are floated, the lower divs are still trying to get to the 'home' position if possible. It is still a work in progress so the style sheet will be re-created once the suits have stopped having meetings and given the go ahead for some actual work. I have left the floats in for now as the page works ok for their latest round of coffee drinking.
Why are people unable to make decisions, these days?

Sorry for he rant but I feel a whole lot better now.

Keith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top