Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I just read your edit, and while it seems you're gone I am going to answer anyway. Don't give up. CSS can be frustrating to troubleshoot and troublesome to implement in the beginning. Inline styles, font tags hell it all seems ever so much easier, until you realize the actual power that CSS gives you over your styling. I think what you should do is step away from your work for a little bit and do some reading on CSS so you're better understanding what it is you're doing, I'm going to give you a couple of tips here that should help with the issues at hand, but I still think you need to read more.</p> <ul> <li><p>Get the styling OUT of the head and back into an external style sheet, that is the worst advice you could have possibly been given.</p></li> <li><p>Read up on specificity first. That is how CSS decides which rule applies if there are conflicting rules. For example take this code:</p> <pre><code>a{color:blue;text-decoration:underline;font-weight:bold;} p{color:red;} a{color:green;font-weight:normal;} </code></pre></li> </ul> <p>Your links are going to turn out green, underlined and normal weight. This is because the green and normal weight came after the blue and bold in the order of how it was read, this is the simplest of the rules, there are others like is it inline, is it an id or a class etc. Read the rules and you'll understand how to write your CSS to get the rules to apply where you want them. This is where the terrible "put it in the head" advice came from because that CSS will be applied after external CSS. Still doesn't make it the right way to do it.</p> <p><ul> <li><p>Learn about Classes and ID's. Just quickly ID's are unique names you can apply to elements for example you could then style just that ID in your CSS with #mainNav{color:blue} the thing to remember about ID's is they are UNIQUE. Do not use 5 UL's with the ID of mainNav (the main reason for this is so you can use them to identify them, say in js or jQuery for example). If you have multiple things that need the same styling you use classes, the nice thing about classes is you can chain them so for an easy example consider the following code:</p></p> <pre><code>.blue{color:blue} .underlined{text-decoration:underline} .bold{font-weight:bold} </code></pre></li> </ul> Seems sort of dumb on first reading but now look at how you could apply that. <pre><code>&lt;p class="bold blue"&gt;This is some blue text&lt;span class="underlined"&gt; some of it is underlined&lt;/span&gt; and some of it isn't&lt;/p&gt; </code></pre> <p>This is where you need to look to solve your problem. If you wanted to apply those list styles just to your nav, adding a class would solve it cascading to other lists. See the following:</p> <pre><code>.nav ul{list-style-type:none;margin:0;padding:0;overflow:hidden;} .nav li{float:left;} .nav a{display:block;width:400px;background-color:#ff0000;color:white;} .nav a:hover,a:active{background-color:#cc0000;} &lt;div class="nav"&gt; &lt;ul&gt; &lt;li&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/ul&gt; </code></pre> <p>Any other lists you create wouldn't take on those styles. Basically you want your external style sheet to start with your basics then get more specific as you go. So the styles you want on every list go at the top and go on the ul and li or ol and li elements, then as you go further down the sheet you can get more specific.</p> <p><strong>Stay away from inline CSS Stay away from CSS in the head</strong></p> <p>Trust me, learn to do it right and you'll be so happy you'll never understand why you did it any other way. Make use of the Chrome inspect element to trace down why something is displaying a certain way and then fix the CSS, forget these hack ways of fixing it. Fix it right.</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. VO
      singulars
      1. This table or related slice is empty.
    2. 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