Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14

Thread: Div Tag Help

  1. #1
    Junior Member
    Join Date
    Mar 2009
    Posts
    7
    Member #
    18646
    I'm experimenting with CSS and the Div Tags. I'm really trying to get two Div containers to line up side by side. Here is the CSS for the two containers:

    .sheet {
    z-index = 1
    position: absolute;
    height: 100px;
    width: 100px;
    }

    .sheet2 {
    z-index = 0
    position: relative;
    height: 100px;
    width: 200px;
    overflow: hidden;

    }


    However when I mention the div tags in the HTML the containers are showing up one beneath the other. How do I get them to appear side by side?

    thanks in advance

  2.  

  3. #2
    Senior Member aeroweb99's Avatar
    Join Date
    Feb 2008
    Location
    Port Huron, Michigan
    Posts
    1,037
    Member #
    16468
    Liked
    1 times
    Float them instead. You can wrap these in a div also if you want to position them on your page as a whole.

    Code:
    .sheet {
        float: left;
        height: 100px;
        width: 100px;
    }
    
    .sheet2 {
        
        float: left;
        height: 100px;
        width: 200px;
        overflow: hidden;
    
    }

  4. #3
    Senior Member Dorky's Avatar
    Join Date
    Jun 2009
    Location
    Destin Florida
    Posts
    1,430
    Member #
    19103
    Liked
    4 times
    idk man, i dont agree with positioning by class.

    while($get_it !== true){ continue; }

  5. #4
    Junior Member
    Join Date
    Mar 2009
    Posts
    7
    Member #
    18646
    Quote Originally Posted by Dorky
    idk man, i dont agree with positioning by class.
    I'm a beginner, please explain why? What difference does it make whether I use ID or Classes for CSS?

  6. #5
    Senior Member aeroweb99's Avatar
    Join Date
    Feb 2008
    Location
    Port Huron, Michigan
    Posts
    1,037
    Member #
    16468
    Liked
    1 times

  7. #6
    Senior Member aeroweb99's Avatar
    Join Date
    Feb 2008
    Location
    Port Huron, Michigan
    Posts
    1,037
    Member #
    16468
    Liked
    1 times
    Quote Originally Posted by Dorky
    idk man, i dont agree with positioning by class.
    There's nothing wrong with floating a class.

  8. #7
    Senior Member Dorky's Avatar
    Join Date
    Jun 2009
    Location
    Destin Florida
    Posts
    1,430
    Member #
    19103
    Liked
    4 times
    Use class selectors when you think you may use them more than once such as text sizing, or some kind of color or something. id's are used more for layout of your divs, so it usually seems anyway.
    ok

    while($get_it !== true){ continue; }

  9. #8
    Member
    Join Date
    Jul 2007
    Posts
    92
    Member #
    15534
    Quote Originally Posted by Dorky
    ok
    I agree with Dorky here. In my understanding, #id's should only be used "once" in your code, so... to position something, where as .class should be used for styling that will be used more than once, such as, a paragraph, font style, etc...

  10. #9
    Senior Member aeroweb99's Avatar
    Join Date
    Feb 2008
    Location
    Port Huron, Michigan
    Posts
    1,037
    Member #
    16468
    Liked
    1 times
    Yes, we established that. The question was, is floating a class semantic. I say yes, Dorky is not so sure.

    For instance, I use rounded corners for boxes on some of my sites for the top and bottom of the boxes. I use a class for those boxes, which each box consists of 4 divs which all use class. Now if I want to use more than one of those boxes on the same page, I can't use id for them, so I gotta use class.

    So the answer to the question, should class selectors be used for layout? I say yes, when it's the only option, otherwise you might find yourself with less options when laying out a page.

  11. #10
    Member
    Join Date
    Jul 2007
    Posts
    92
    Member #
    15534
    Quote Originally Posted by aeroweb99
    Yes, we established that. The question was, is floating a class semantic. I say yes, Dorky is not so sure.

    For instance, I use rounded corners for boxes on some of my sites for the top and bottom of the boxes. I use a class for those boxes, which each box consists of 4 divs which all use class. Now if I want to use more than one of those boxes on the same page, I can't use id for them, so I gotta use class.

    So the answer to the question, should class selectors be used for layout? I say yes, when it's the only option, otherwise you might find yourself with less options when laying out a page.
    Yes, class selectors may be used for layout, if required because using more than once, IMO.


Page 1 of 2 1 2 LastLast

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 02:36 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com