Div and semantic tags usage
Question - For the example below, do I still need a div id="header" since there is a header class="header"? Is it because of the div's flexibility for styling purpose if I happened to add/style anything to it next time? I did see the Freecodecamp project website example having a semantic tag like header tag nested in non-semantic div. So I follow suit.
As for CSS, I never style anything to the div id="header". I asked this question because it feels the div is a little redundant and I assume, lesser tags and codes make cleaner and clearer coding?
.logo {
margin: 20px 0 0 20px;
}
.logo img {
max-width: 230px;
}
header {
display: flex;
font-weight: 700;
font-family: Arial, Helvetica, sans-serif;
color: #fff;
justify-content: space-around;
align-items: baseline;
} <!-- Header Wrap-->
<div id="header">
<!-- Logo-->
<header class="header">
<div class="logo"><a href="#"><img src="../t/img/b.png" alt="logo" /></a></div>
<!--Navigation-->
<nav class="header-menu">
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">Terms</a></li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
</header>
</div> -
savidge4 -
[ 1 ] Thanks
SignatureSuccess is an ACT not an idea{{ DiscussionBoard.errors[11717873].message }} -