Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>From my knowledge you can achieve this by </p> <p><strong>pure <code>css</code> using <code>position:absolute</code>.</strong></p> <p><strong>and with the help of jQuery</strong></p> <p>I've solve your problem by both ways check out below solutions</p> <p>I've checked and find some bugs in your code </p> <p><strong>1. in your <code>html</code> code you forget to close your <code>&lt;div id="two"&gt;</code>.</strong> *<em>2. In your <code>css</code> code there you applied <code>height:100%</code> to your class which are reflecting.</em>* <strong>3. In your <code>jQuery</code> code you are trying to set height but with wrong selectors. That's why your code is not working</strong></p> <p>so i've fixed it in my case you have to change in your css code, html code and jquery code check this fiddle <a href="http://jsfiddle.net/yNg95/2/" rel="nofollow">http://jsfiddle.net/yNg95/2/</a></p> <p><strong>here is Html</strong></p> <pre><code>&lt;div class="header" id="one"&gt;hi&lt;/div&gt; &lt;div class="border" id="two"&gt; hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br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gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt;hi&lt;br&gt; &lt;/div&gt; </code></pre> <p><strong>here is css code</strong></p> <pre><code>*{margin:0; padding:0;} body { background-image:url(../images/bg.png); background-repeat:repeat; color: #FFFFFF; overflow:hidden; } .header{ position: absolute; left: 0; top: 0; right:0; height: 120px; background-color: black; box-shadow: 0px 0px 40px #000000; } .border{ position: absolute; left: 25%; z-index:0; width: 50%; top:120px; /*height: 100%;*/ background-color: white; color: black; padding: 5px; overflow-y:scroll; } </code></pre> <p><strong>here is jquery code</strong></p> <pre><code>var one, two; one = $('.header').outerHeight(true); two = $(window).height() - one; console.log(one, two) $('#two').css({height : two}) </code></pre> <p><strong>here is the fiddle for another option only by pure <code>css</code></strong></p> <p><a href="http://jsfiddle.net/sarfarazdesigner/neR4U/" rel="nofollow">http://jsfiddle.net/sarfarazdesigner/neR4U/</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. 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