Note that there are some explanatory texts on larger screens.

plurals
  1. PONesting DIV - Nested DIV doesn't take height?
    primarykey
    data
    text
    <p>So I'm trying to set the height of the "content" class but it doesn't seem to be working. I'm quite a noob at nested DIVs and I've tried the fixes that I've found googling but nothing seems to work. Help? </p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; &lt;html&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/&gt; &lt;meta name="description" content="Website Horizontal Scrolling with jQuery" /&gt; &lt;meta name="keywords" content="jquery, horizontal, scrolling, scroll, smooth"/&gt; &lt;link rel="stylesheet" href="css/style.css" type="text/css" media="screen"/&gt; &lt;/head&gt; &lt;style&gt; body { background-mage: url(bg.jpg), url(bgrepeat.jpg); background-repeat: no-repeat, repeat-x; background-attachment:fixed; background-position:left bottom; background-color: #D3C8B6; } #wrapper { text-align: center; width: 100%; position:absolute; bottom:0; } #header, #main, #sidebar, #footer { display:inline; position:relative; float:left; } #header, #footer { width:100%; background-color:#eee; opacity:1.0; filter:alpha(opacity=100); } #header { margin-bottom:1%; height:100px; } #footer { margin-top:1%; height:40px; } #main { width:20%; height:475px; margin-right:1%; text-align: center; background-color:#eee; opacity:1.0; filter:alpha(opacity=100); } #sidebar { width:79%; height:475px; overflow: hidden; } .viewport{ width:100%; height:475px; overflow-x:scroll; } .inside{ width:9000px; height:200px; } .inside div{ height:450px; width:700px; float:left; margin-right:4px; } .content { height:100px; width:300px; overflow-y: scroll; position:relative; top: 10px; right:10px; } .one{ background-image: url(images/frame.png) } .two{ background-image: url(images/frame2.png); text-align:center; z-index: 1; } .three{ background-image: url(images/frame1.png); } .four{ background-image: url(images/frame3.png); } .five { background-image: url(images/frame4.png); } &lt;/style&gt; &lt;body&gt; &lt;div id="wrapper"&gt; &lt;div id="header"&gt; &lt;/div&gt; &lt;div id="main"&gt; &lt;div class="one-l"&gt;Home&lt;/div&gt; &lt;div class="two-l"&gt;Portfolio&lt;/div&gt; &lt;div class="three-l"&gt;Resume&lt;/div&gt; &lt;div class="four-l"&gt;Blog&lt;/div&gt; &lt;div class="five-l"&gt;Contact&lt;/div&gt; &lt;/div&gt; &lt;div id="sidebar"&gt; &lt;div class="viewport" &gt; &lt;div class="inside" &gt; &lt;div class="one"&gt;home&lt;/div&gt; &lt;div class="two"&gt; &lt;div class="content" width="200"&gt; Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas bibendum, leo vitae ornare dignissim, lorem urna tempor felis, in fringilla urna justo non velit. Cras imperdiet viverra ligula, vitae auctor neque elementum eget. In nec quam est, quis molestie magna. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec gravida, elit a iaculis consequat, ligula nisl cursus turpis, in giat eu placerat vel, viverra vel nibh. Ut vitae felis ac nisi euismod porta. Aliquam et gravida mauris. Maecenas id massa ligula, et blandit orci. In hac habitasse platea dictumst. Donec eu tortor libero. Donec eget leo mi. Mauris quis neque vitae massa facilisis placerat ut et felis. Nullam eleifend faucibus diam, sit amet pellentesque leo euismod id. Morbi interdum placerat nibh, in mattis sem eleifend quis. Nunc non nunc sed lorem condimentum molestie mattis blandit dui. Nulla urna ligula, auctor id venenatis eu, placerat ut dui. In fringilla purus gravida sapien cursus imperdiet porta ligula lobortis. Sed pellentesque, nisi quis tristique pulvinar, justo odio sollicitudin risus, non euismod dui ante nec tortor. &lt;/div&gt;&lt;/div&gt; &lt;div class="three"&gt;resume&lt;/div&gt; &lt;div class="four"&gt;blog&lt;/div&gt; &lt;div class="five"&gt;contact&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre>
    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.
 

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