...

View Full Version : I Need Help!



taylortsantles
07-18-2008, 08:40 PM
This may be a dumb question, but I'm kind of new to this whole thing. I'm coding a site with CSS and am running into a few issues with floating objects.
For instance, when I float an object right, and then I float another one, it aligns the second object on the left side of the first, rather than under it. I hope someone can understand that. I want to float things to the right, stacked on top of each other, not next to each other. What do I do?

jcdevelopment
07-18-2008, 08:42 PM
.boxItem {
float:right;
clear:right;
}
.boxItem {
float:right;
clear:right;
}

Thats an example of clearing floats, or just creat a class to do it.



.clear {
clear:both;
}

taylortsantles
07-18-2008, 08:43 PM
Thank you so much, I'll give it a try.

_Aerospace_Eng_
07-18-2008, 08:43 PM
Create a div that surrounds the floats that is just wide enough for the floats. Now float the div rather than the floats. If you kept floating things to the right you could use clear:right; on the floats so they stack below each other but its going to be harder to work with those floats.

taylortsantles
07-18-2008, 08:48 PM
That's a great idea. I think that will work the best. I appreciate it.

taylortsantles
07-18-2008, 08:51 PM
Is using margin the best way to position things within divs?

_Aerospace_Eng_
07-18-2008, 08:52 PM
Depends on what type of layout you are going for but yes its better to avoid absolute positioning.

Check out the CSS Layouts here: http://bonrouge.com

taylortsantles
07-18-2008, 08:54 PM
Making a separate div for it worked great. I really appreciate the advice.

Thanks,
Taylor



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum