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 12

Thread: Div height

  1. #1
    Senior Member kirman's Avatar
    Join Date
    May 2003
    Location
    UK England
    Posts
    765
    Member #
    1499
    Liked
    2 times
    Hello all,

    just something that's bugging me, I started using the min-height for most of my dive so that they would expand with the text and move the footer further down the page.

    Well that's all well and good but what about if i wanted the div set at 400px minimum height and then if more text it will expand. How can I achieve this?

    Cheers
    Dream like you'll live forever. Live like you're gonna die 2morrow!

  2.  

  3. #2
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,485
    Member #
    425
    Liked
    2783 times
    Leave it alone, put a large chunk of text in, and you'll find the result you seek...unless something's interfering with it.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  4. #3
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    Min-height is not handled by all browsers either... So set it to height:auto , with decent padding and let it go

  5. #4
    Senior Member kirman's Avatar
    Join Date
    May 2003
    Location
    UK England
    Posts
    765
    Member #
    1499
    Liked
    2 times
    well all is well until i slam a background in there lol

    http://connordesign.comyr.com/div.html what is causing the bg to do that? Seems to me like the text is overflowing and the bg is stopping lol

    cheers
    Dream like you'll live forever. Live like you're gonna die 2morrow!

  6. #5
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,485
    Member #
    425
    Liked
    2783 times
    Uncleared floats are. Yes, you're using your footer div to clear floats, but you need to do it immediately after your right div, since both of those divs are in a container.

    Put this after your right div and watch what happens (then clean it up afterward so that it's coded properly...this is just to illustrate a point):
    <div style="clear: both;"></div>
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  7. #6
    Senior Member kirman's Avatar
    Join Date
    May 2003
    Location
    UK England
    Posts
    765
    Member #
    1499
    Liked
    2 times
    if i add what you said nothing happens.
    Code:
    <div class="right"></div>
    
    <div style="clear:both;"></div>
    strange.... any ideas lol
    Dream like you'll live forever. Live like you're gonna die 2morrow!

  8. #7
    Senior Member Ronald Roe's Avatar
    Join Date
    Mar 2011
    Location
    Oklahoma City
    Posts
    3,141
    Member #
    27197
    Liked
    959 times
    Code:
    .right::after{
      clear:both;
      content:"";
      display:block;
      height:0;
      width:0;
    }
    Ron Roe
    Web Developer
    "If every app were designed using the same design template, oh wait...Bootstrap."

  9. #8
    Senior Member kirman's Avatar
    Join Date
    May 2003
    Location
    UK England
    Posts
    765
    Member #
    1499
    Liked
    2 times
    I didnt understand that code above at all nor where to put it.

    Someone please help
    Dream like you'll live forever. Live like you're gonna die 2morrow!

  10. #9
    Senior Member kirman's Avatar
    Join Date
    May 2003
    Location
    UK England
    Posts
    765
    Member #
    1499
    Liked
    2 times
    Anyone?
    Dream like you'll live forever. Live like you're gonna die 2morrow!

  11. #10
    Senior Member Andrew Yurlov's Avatar
    Join Date
    Apr 2011
    Location
    Portland, OR
    Posts
    1,306
    Member #
    27566
    Liked
    181 times
    That code is css.... Put it in a css file and attach it to the website. Then again, if you don't understand that code, this probably sounds like Mandarin to you right now....
    Artificial intelligence is nothing compared to natural stupidity -Someone

    Design is a funny word. Some people think design means how it looks.
    But of course, if you dig deeper, itís really how it works.
    -Steve Jobs




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