Note that there are some explanatory texts on larger screens.

plurals
  1. POAligning two divs with header div
    primarykey
    data
    text
    <p>I'm trying to get a layout to look like this following:</p> <p><a href="http://i42.tinypic.com/2i8wyrk.png" rel="nofollow">http://i42.tinypic.com/2i8wyrk.png</a></p> <p>I've managed to get the "content" div aligned fine with the header div, but I'm not sure how to put the nav div in there and keep it aligned properly. This is what I have so far:</p> <pre><code>&lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt; &lt;title&gt;Page Title&lt;/title&gt; &lt;style&gt; div#container { position: relative; } body { background-color: #121212 } div#header { background-color: #900; width: 70%; height: 10%; border: 2px solid #488ed0; margin: 0 auto; } div#nav { position: absolute; background-color: #900; border: 2px solid #488ed0; width: 150px; height: 200px; float: left; } div#content { border: 2px solid #488ed0; background-color: #900; width: 70%; height: 900px; margin: 0 auto; } a { color: #FFFFFF; text-decoration: none; } a:hover { color: #000000; text-decoration: underline; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;div id = "container"&gt; &lt;div id="header"&gt; &lt;center&gt;&lt;img src = "images/logo.png" /&gt;&lt;/center&gt; &lt;/div&gt; &lt;br /&gt; &lt;div id="nav"&gt; &lt;center&gt;&lt;br /&gt; &lt;a href='#'&gt;Index&lt;/a&gt;&lt;br /&gt; &lt;a href='#'&gt;About&lt;/a&gt;&lt;br /&gt; &lt;a href='#'&gt;Contact&lt;/a&gt; &lt;/center&gt; &lt;/div&gt; &lt;div id="content"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>How can I align the nav div as it is in the example mockup I made? I want to make sure the left side of 'nav' stays aligned with the header, and the right side of 'content' stays aligned with the right side of the header.</p>
    singulars
    1. This table or related slice is empty.
    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.
    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