...

View Full Version : .class question



jcdevelopment
02-13-2008, 05:49 PM
hey all,

I have a question about classes and how to set them a certain way! If i have one class, and of course i can set it to as many things as i want. My problem lies in the whole floating scheme when it come to classes.

heres my problem i have a single class




.someName {
styling man......
float:left;
}



now i have many different things to add this class to, such as




<div class="someName">
<form>
blah blah....
</form>
</div>

<div class="someName">
<form>
blah blah....
</form>
</div>

<div class="someName">
<form>
blah blah....
</form>
</div>




no, the problem is they will all float left and i want them to line up in a horizontal manner. Unfortunately i know that they wont do that, is there a way withought creating a new div displaying:inline to make them automatically line up one after another?

Sorry i know this is confusing, but im just trying to see if there is an alternative to creating alot of code!! Let me know if you need a better explenation!!

Thanks guys

Andrew Johnson
02-13-2008, 05:55 PM
Add this to your CSS:


.someName form
{
display:inline;
float:left
}

_Aerospace_Eng_
02-13-2008, 06:13 PM
The display:inline; is redundant if you don't set any margins on the form. An element floated left can't be display:inline; at the same time. It automatically becomes display:block. If you have margins in the direction of the float then display:inline; is needed to overcome the double margin bug in IE6.

jcdevelopment
02-13-2008, 06:20 PM
ahh, much enlightment here in this forum, thank you guys!!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum