May 30, 201313 yr How can I fill display height using one div ? I've got static width of 800px and I need to set height of div to be from top to bottom and avoid of scrolling on smaller resolutions . This condition I need when div content is empty . If there is a lot of text or any other content and filling all div it should automatically extend div and then should be possibility of scrolling . I hope you understand what I mean , simply I need something like div{min-height:100%; } and if needed automaticaly extend the div . I want it like preventing of webpage end is in middle of screen on some resolutions and on other it's on a bottom . Simple example is web what I'm doing now http://www.new.pizzamako.sk
May 30, 201313 yr I think what you need to do is as well as setting the height of the DIV to 100%, you need to set it's container element to 100% height. This fiddle shows a simple example: http://jsfiddle.net/LyndseyB/3c2XM/ If that's not what you mean, my apologies Let me know if that helps
May 30, 201313 yr Chris Coyier wrote an article about creating the perfect background a while ago, not the same thing as what you're asking for but it could become relevant later on for you: http://css-tricks.com/perfect-full-page-background-image/
June 2, 201313 yr Author I think what you need to do is as well as setting the height of the DIV to 100%, you need to set it's container element to 100% height. This fiddle shows a simple example: http://jsfiddle.net/LyndseyB/3c2XM/ If that's not what you mean, my apologies Let me know if that helps I've found out when <!DOCTYPE HTML> specified on begining of the html5 document height value stated in % it's not working , anyone known why ? and how to overcome this ? Edited June 2, 201313 yr by NiBi18
Create an account or sign in to comment