Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I think it could be solved like:</p> <pre><code>.page { background-color: #8f8; min-height: 100%; width: 80%; } .header { background-color: #fdc; overflow: hidden; } .content { background-color: #ccf; overflow-y: auto; height: 100%; width: 100%; /*word-wrap: break-word;*/ } </code></pre> <p>Ok, what I have done:</p> <ol> <li>Page: you can put simply height to 200px if you really know the size of the heigh, but it makes more sense to me adding <code>min-height: 100%</code> to make the page fill all the space.</li> <li>Header: To allow the header resize when the content changes it is necesary setting its overflow as hidden. This will avoid for displaying any kind of scroll. Of course it must be a block element, like div or then you will have to add <code>display:block</code>.</li> <li>Content: Here put the height as 100% of the space, allow the visibility of the vertical scroll only when neded and break words only if the content you will display can make the horizontal scroll to appear.</li> </ol> <p>Finally, to avoid the page going off the bottom put the header as part of the content div. Ask me for more details.</p> <p><strong>UPDATE</strong>: here is the <a href="http://jsbin.com/eyolud/8/edit" rel="nofollow">example</a> where I have tested it.</p> <p><strong>UPDATE2</strong> The best I have gotten is <a href="http://jsbin.com/eyolud/15/edit" rel="nofollow">this</a>:</p> <pre><code>.page { background-color: #ccf; max-height: 100%; width: 80%; overflow: hidden; } .header { background-color: #fdc; overflow: hidden; } .content{ overflow-y: auto; height: 100%; word-wrap: break-word; } </code></pre> <p>The only problem it has is that the scroll thinks that what it is scrolling is all the "page" element not only the content, so you can not see the final arrow of the scroll. I think this could be solved by using javascript, but with css I think there is no better solution.</p> <p>Javascript possible solution:</p> <pre><code>$(window).resize(function() { resizeContent(); }); $(document).load(function(){ resizeContent(); }); function resizeContent(){ $('.content').height($(".page").height()-$('.header').height()); } </code></pre> <p>The link with a final solution could be found <a href="http://jsbin.com/eyolud/17/edit" rel="nofollow">here</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload