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 15

Thread: Giant divs

  1. #1
    WDF Staff George Dolidze's Avatar
    Join Date
    Apr 2011
    Location
    Irvine, CA
    Posts
    2,487
    Member #
    27540
    Liked
    416 times
    I want to put about 3 large divs next to each other, so only one is visible on screen at a time. I don't know how to do this. If I use float, then they just jump down instead of overflowing. If I don't use float, then they are automatically block elements.
    I want the divs situated like so:

    divs.png

    Should I use tables, even though that's a bad thing to do..?
    Sorry if it's a stupid question, but I just can't figure it out
    My freelancer website: DolidzeDesign



    You only need a parachute if you plan on skydiving twice.

  2.  

  3. #2
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    Try a wrapper div to put them all in and set the width to a little larger that the combined width of all 3. Not a big fan of absolute widths as each browser resolution handles them differently.

    A wrapper div of 300% and your 3 current divs to 99% each should work

  4. #3
    WDF Staff George Dolidze's Avatar
    Join Date
    Apr 2011
    Location
    Irvine, CA
    Posts
    2,487
    Member #
    27540
    Liked
    416 times
    Quote Originally Posted by Webzarus, post: 218615
    Try a wrapper div to put them all in and set the width to a little larger that the combined width of all 3. Not a big fan of absolute widths as each browser resolution handles them differently.

    A wrapper div of 300% and your 3 current divs to 99% each should work
    Trying that as we speak.
    My freelancer website: DolidzeDesign



    You only need a parachute if you plan on skydiving twice.

  5. #4
    WDF Staff George Dolidze's Avatar
    Join Date
    Apr 2011
    Location
    Irvine, CA
    Posts
    2,487
    Member #
    27540
    Liked
    416 times
    Now the divs themselves became super wide. I think this is because they take up 99% of the wrapper, which is 300% wide. So the divs end up basically 300% wide..
    My freelancer website: DolidzeDesign



    You only need a parachute if you plan on skydiving twice.

  6. #5
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    Ok... Then try 33%... sorry... First cup of coffee

  7. #6
    Senior Member Ganners's Avatar
    Join Date
    Feb 2011
    Location
    United Kingdom
    Posts
    415
    Member #
    27007
    Liked
    92 times
    What you need is like:

    HTML Code:
    <div id="scroll" style="display: block; overflow: hidden;">
    <div id="scroll-container" style="width:200000px; display: block;">
    <section id="section-1" style="width:600px; float: left; padding: 0 30px; display: block;">Section 1</section>
    <section id="section-2" style="width:600px; float: left; padding: 0 30px; display: block;">Section 2</section>
    <section id="section-3" style="width:600px; float: left; padding: 0 30px; display: block;">Section 3</section>
    </div>
    </div>
    Mark Gannaway Software Developer

    Recent Experiments
    - Backpropogation Neural Network language solving (http://ann.ganners.co.uk/)
    - Animated image to ASCII (http://google.ganners.co.uk/)
    - 3D Paper Characters (http://cybergame.ganners.co.uk/)
    - Anagram solving (http://roflol.co.uk/)

  8. #7
    WDF Staff George Dolidze's Avatar
    Join Date
    Apr 2011
    Location
    Irvine, CA
    Posts
    2,487
    Member #
    27540
    Liked
    416 times
    Quote Originally Posted by Webzarus, post: 218623
    Ok... Then try 33%... sorry... First cup of coffee
    Oh, right! Now I've just gotta figure out margins. Thanks for getting me started.

    lol, I had coffee at 4pm, now it's 3am and i still can't sleep.
    My freelancer website: DolidzeDesign



    You only need a parachute if you plan on skydiving twice.

  9. #8
    WDF Staff George Dolidze's Avatar
    Join Date
    Apr 2011
    Location
    Irvine, CA
    Posts
    2,487
    Member #
    27540
    Liked
    416 times
    Quote Originally Posted by Ganners, post: 218624
    What you need is like:

    HTML Code:
    <div id="scroll" style="display: block; overflow: hidden;">
    <div id="scroll-container" style="width:200000px; display: block;">
    <section id="section-1" style="width:600px; float: left; padding: 0 30px; display: block;">Section 1</section>
    <section id="section-2" style="width:600px; float: left; padding: 0 30px; display: block;">Section 2</section>
    <section id="section-3" style="width:600px; float: left; padding: 0 30px; display: block;">Section 3</section>
    </div>
    </div>
    What is this sorcery? I've never heard of <section> tags before. Can you explain what you did there?
    My freelancer website: DolidzeDesign



    You only need a parachute if you plan on skydiving twice.

  10. #9
    Senior Member Ganners's Avatar
    Join Date
    Feb 2011
    Location
    United Kingdom
    Posts
    415
    Member #
    27007
    Liked
    92 times
    Ohh, its just a HTML5 tag, basically a div, but with a different name. Would still work if you renamed it to div though.
    Mark Gannaway Software Developer

    Recent Experiments
    - Backpropogation Neural Network language solving (http://ann.ganners.co.uk/)
    - Animated image to ASCII (http://google.ganners.co.uk/)
    - 3D Paper Characters (http://cybergame.ganners.co.uk/)
    - Anagram solving (http://roflol.co.uk/)

  11. #10
    WDF Staff AlphaMare's Avatar
    Join Date
    Oct 2009
    Location
    Montreal, Canada
    Posts
    4,570
    Member #
    20277
    Liked
    878 times
    Quote Originally Posted by George Dolidze, post: 218628
    What is this sorcery? I've never heard of <section> tags before. Can you explain what you did there?
    Gotta love HTML5...
    http://www.w3schools.com/html5/tag_section.asp
    Good design should never say "Look at me!"
    It should say "Look at this." ~ David Craib


    http://digitalinsite.ca ~ my current site . . info@digitalinsite.ca ~ my email

    If you feel that someone's post helped you fix your problem, answered your question, or just made you feel better, feel free to "Like" their post. The "Like" link is at the bottom right of each post, along side the "reply" link. And if you are being helped here, try to help someone else - pass it on!


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 11:52 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com