Note that there are some explanatory texts on larger screens.

plurals
  1. POJust getting to grips with CSS. Can some tell me why my content div is slightly poking out the right edge?
    primarykey
    data
    text
    <p>Here is the link.</p> <p><a href="http://jsfiddle.net/8X4UE/" rel="nofollow">http://jsfiddle.net/8X4UE/</a></p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;link rel="stylesheet" type="text/css" href="stylesheet.css"&gt; &lt;title&gt;Project One&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;div class="header"&gt; &lt;p&gt;#Project One&lt;/p&gt; &lt;/div&gt; &lt;ul class="nav"&gt; &lt;li&gt;&lt;a href="#"&gt;Home&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;About&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;FAQs&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Contact Us&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Forum&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;div class="content"&gt; &lt;p&gt;Content goes here!&lt;/p&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>CSS:</p> <pre><code>/* The CSS */ body { margin: 0 20%; background-color: #333333; } .header{ width: 100%; float: left; margin: 0; padding: 0; background-color: #336699; } .header p{ margin-left: 1em; font-family: Verdana; font-size: 1.2em; color: #e2e2e2; } .nav{ width: 100%; float: left; margin: 0 0 0 0; padding: 0; list-style: none; background-color: #f2f2f2; border-bottom: 1px solid #ccc; border-top: 1px solid #ccc; } .nav li{ float: left; } .nav li a{ display: block; padding: 8px 15px; text-decoration: none; font-weight: bold; color: #069; border-right: 1px solid #ccc; } .nav li a:hover{ color: #c00; background-color: #fff; } .content { display: block; width: 100%; background-color: #FFFFCC; margin: 0; border: 1px solid #ccc; clear: both; } </code></pre> <p>I can't understand why it is just pipping out like that. It seems if I remove the padding/float it almost sorts it, but then leaves a yellow border across all three sections.</p> <p>I'd like any general advice with my coding so far if you have any too. I want to nip bad habits in the bud asap.</p>
    singulars
    1. This table or related slice is empty.
    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.
 

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