I'm trying to accomplish something very simple as seen here.
HTML
<div id="header">
<div class="container">
<img src="#">
<ul id="header_nav">
<li>Link</li>
<li>Link</li>
<li>Link</li>
</ul>
</div>
</div>
CSS
.container {
padding-left: 80px;
padding-right: 80px;
}
#header {
height: 50px;
line-height: 50px;
background-color: blue;
}
#header_nav {
float:right;
}
#header_nav li {
display: inline-block;
}
Questions:
- Am I using the IDs and classes correctly? For example, should header be an ID or class?
- Is my naming convention ok?
- Should I be using nested rules instead? E.g
#header ul li { ... }
- Is this the best way to achieve this layout?
Any advice at this stage would be good, so I can take these practices forward when doing the next steps of the structure.
<!DOCTYPE html>
) is automatically included (although it would be beneficial for the poster to learn about the different doctypes, how they differ, and what HTML5 offers). – WChargin Sep 1 '14 at 18:34