Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Using the table display properties, you could overcome the firefox problem by wrapping two more elements around the text of the scrolling section, so you have three:</p> <ul> <li>the outer one is a <code>table-row</code> container that fills the rest of the table</li> <li>inside which we have a <strong>relatively</strong> positioned container with <code>height</code> and <code>width</code> set to <code>100%</code>, and with set vertical scrolling <code>overflow-y:scroll;</code></li> <li>the innermost container is <strong>absolutely</strong> with <code>height</code> and <code>width</code> also set to <code>100%</code></li> </ul> <p>So here I just quickly added two div containers around your content paragraph (you could probably found a more appropriate set of containers according to your needs, but this will do for the illustration):</p> <pre><code>&lt;div id="wrapper"&gt; &lt;h2 id="date"&gt;Date&lt;/h2&gt; &lt;h1 id="title"&gt;A title ...&lt;/h1&gt; &lt;div id="contentbox-outer"&gt; &lt;div id="contentbox-inner"&gt; &lt;p id="content"&gt;The content ...&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>And your whole CSS has to be modified. Your original selectors, with slight modifications:</p> <pre><code>#wrapper { position:absolute; display: table; table-layout:fixed; background-color:black; padding:10px; width: 250px; height:350px; border-spacing:20px; } #date { display: table-row; font-weight: normal; font-size: 25px; background-color:yellow; } #title { display: table-row; font-weight: normal; font-size: 40px; line-height:90%; background-color:blue; } </code></pre> <p>note that the <code>table-row</code> and <code>table</code> elements take now speciffinc styling for tables, like the <code>border-spacing</code> property that sets spacing between the table rows, and this you can now combine with the padding property of the table for the appearance you want.</p> <p>And the styling for the added containers would be something like this (first is still based on your styling, the last two are the additional - inner ones):</p> <pre><code>#contentbox-outer { display: table-row; font-size: 12pt; width: 100%; height:90% !important; text-align: justify; background-color:red; overflow-y: scroll; } #contentbox-inner { position:relative; height:100%; width:100%; overflow-y:scroll; } #content { position:absolute; height:100%; width:100% } </code></pre> <p>I also updated your fiddle for a quick check: <a href="http://jsfiddle.net/3HYJx/7/" rel="nofollow">http://jsfiddle.net/3HYJx/7/</a></p> <p><strong>Edit:</strong> This works in browsers like Firefox, Chrome, Safari, but for example not in Opera cause <code>height: 100%</code> does not get rendered in documents in strict mode. So with a little more research I found out that you can get it to work in <strong>quirks mode</strong>, here is a <strong><a href="http://newtpond.com/quirksmode.html" rel="nofollow">test html</a></strong> - the above code but in a quirks mode document. Thanks for giving me a reason to learn that, it's good to know =)</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.
    3. 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