Note that there are some explanatory texts on larger screens.

plurals
  1. POhtml, css with center div problem
    text
    copied!<p>I would like to create centered html page with three separated columns (with different colors). I can't find solution for my #container1 in css. The red color is spreading from left side(out of the centered page). Here it is: <a href="http://imgur.com/D3ZAV" rel="nofollow">http://imgur.com/D3ZAV</a> can someone please help me? thanks</p> <pre><code> &lt;body&gt; &lt;div id="cela"&gt; &lt;div id="header"&gt; &lt;p&gt;hlavicka&lt;/p&gt; &lt;/div&gt; &lt;div id="container3"&gt; &lt;div id="container2"&gt; &lt;div id="container1"&gt; &lt;div id="lavy"&gt;&lt;p&gt;Etiam ante est&lt;/p&gt;&lt;/div&gt; &lt;div id="stredny"&gt;&lt;p&gt;Mauris orci erat&lt;/p&gt;&lt;/div&gt; &lt;div id="pravy"&gt;&lt;p&gt;Quisque tincidunt congue orci, &lt;/p&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div id="footer"&gt; &lt;p&gt;footer&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; </code></pre> <p>CSS file</p> <pre><code>#cela { width: 80%; margin-left: auto; margin-right: auto; border: 1px #110000 solid; } #header { padding:20px; background:#008000; } #footer { clear: both; padding:20px; background:#008000; } #container3 { float:left; width:100%; background:green; } #container2 { float:left; width:100%; background:yellow; position:relative; right:30%; } #container1 { float:left; width:100%; background:red; position:relative; right:40%; } #container0 { float:left; width:100%; background:white; position:relative; right:0%; } #lavy { float:left; width:30%; position:relative; left:70%; } #stredny { float:left; width:40%; position:relative; left:70%; } #pravy { float:left; width:30%; position:relative; left:70%; } </code></pre> <p>(sorry for bad formatting, i can't figure out why it is so shitty )</p>
 

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