Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Your code should be:</p> <pre><code>&lt;div id="aboutus"&gt; &lt;div class="header"&gt;&lt;div class="headerbar"&gt;&lt;p&gt;ABOUT US&lt;/p&gt;&lt;/div&gt;&lt;/div&gt; &lt;div class="contentarea"&gt; &lt;p&gt;CONTENT ABOUT US&lt;/div&gt; &lt;/div&gt; &lt;div id="clear"&gt;&lt;/div&gt; &lt;div id="contact"&gt; &lt;div class="header"&gt;&lt;div class="headerbar"&gt;&lt;p&gt;CONTACT US&lt;/p&gt;&lt;/div&gt;&lt;/div&gt; &lt;div class="contentarea"&gt;CONTENT CONTACT US&lt;/div&gt;&lt;/div&gt; &lt;div id="clear"&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p>And:</p> <pre><code>#aboutus { float:left; width:100%; height:100%; } #contact{ float:left; width:100%; height:100%; } #headerbar { float:left; text-align:right; padding-right:5px; } .contentarea{ float:left; width:70%; height:100px; } #clear{ clear: both; } .header{ width:25%; height:100px; background:url(bg.png) no-repeat center center; background-size:contain; float: left; } div {border:1px black solid; } </code></pre> <p>I added borders so you can see where your divs are. Floats are aways tricky to deal with, and more complicated when you use it 100% of your screen. </p> <p>Tip: use ID for unique objects on your code, and CLASS for elements that repeat on the same page (#id is for single elements, .class is for when you want to apply the same style to more than one element on your page). </p> <p>Play here: <a href="http://jsfiddle.net/VPzyy/" rel="nofollow">http://jsfiddle.net/VPzyy/</a></p> <p>Good luck!</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