I’m just following book and finding a few basic mistake so far.
The author has just explained the differences between a Class Selector and an ID Selector. However, I’m not convinced that the <div id=“footer”>This is the footer area</div should really say <div class=“footer”>This is the footer area</div>
So far, I can actually see that there is not class “current” set within the .css file so thats good as far as I can see.
However, its mainly the div called “footer” that I would like someone to check over please.
Can someone check this for me before I get too involved to find that I get problems please.
This is the html file:-
<meta charset=“utf-8” />
<link href=“/StyleSheet.css” rel=“Stylesheet” type=“text/css” />
<div id=“header”>This is the head content</div>
<a href=“home.cshtml” class=“current”>Home</a> |
<a href=“about.cshtml”>About</a> |
<div id=“content”>This is where the rest of the page content goes</div>
<div id=“footer”>This is the footer area</div>
List-style: none removes the default bullet points from the UL
overflow: hidden is not essential, but it’s there to make the UL wrap around the floated LIs. It’s needed if you have a background color on the UL, for example.
Regarding the footer, can you say why it starts with a . full stop in the style sheet.
Yes you can have any of the alternative. For classes styling you use dot(.) and forl Ids you use hash (#). If you have still confusion then here are some references for making the concept even clearer: http://www.w3schools.com/css/css_id_class.asp
Also in the .html file, could alternative fix be to declare the div like this:-
Not without reason, though. It’s rare that I need more than one, so don’t assume you’ll need lots. It’s only in rare cases where you have, say, a series of boxes that are mostly the same but there are slight differences to each. The diferences can be handled by a separate class.