Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: .class question

  1. #1
    Senior Coder jcdevelopment's Avatar
    Join Date
    Oct 2007
    Location
    Cowboy Nation
    Posts
    2,182
    Thanks
    174
    Thanked 257 Times in 257 Posts

    .class question

    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

    Code:
    .someName {
    styling man......
    float:left;
    }
    now i have many different things to add this class to, such as

    Code:
    <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

  • #2
    Banned
    Join Date
    Feb 2008
    Location
    Winnipeg, Canada
    Posts
    396
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Add this to your CSS:
    Code:
    .someName form
    {
    display:inline;
    float:left
    }

  • Users who have thanked Andrew Johnson for this post:

    jcdevelopment (02-13-2008)

  • #3
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • Users who have thanked _Aerospace_Eng_ for this post:

    jcdevelopment (02-13-2008)

  • #4
    Senior Coder jcdevelopment's Avatar
    Join Date
    Oct 2007
    Location
    Cowboy Nation
    Posts
    2,182
    Thanks
    174
    Thanked 257 Times in 257 Posts
    ahh, much enlightment here in this forum, thank you guys!!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •