- Impact
- 5,741
As i am trying to learn good habits from the start i am going ask which is the better proposition out of the follow few examples, i have looked at a few online videos and seeing variations in the info given. At the end of the day they all seem to work but it would be good to start in the best manner.
Example One of how to start a css file All through the html page he only uses one class example (for the banner)
@charset "UTF-8";
article, aside, footer, header, main, nav, section {
display:block;
}
article, aside, footer, header, main, nav, section {
pading: 0;
margin: 0;
}
body {
background-color:#777;
width:960px;
margin-left:auto;
margin-right:auto;
}
Etc ...
Example Two Using Classes all the through the html file for reference in the css file
<body class="body"> on the html file which is then used to style via .body on the css { example}
.body {
background-color:#777;
width:960px;
margin-left:auto;
margin-right:auto;
}
Etc….
After this he goes onto add a class to nearly every thing, article, aside, footer, header, main, nav, section
So i am wondering if the top example where most is done within the page tags is normally used or is it better practice to be adding a class to all the page tags ( article, aside, footer, header, main, nav, section) as i construct a webpage,
Example One of how to start a css file All through the html page he only uses one class example (for the banner)
@charset "UTF-8";
article, aside, footer, header, main, nav, section {
display:block;
}
article, aside, footer, header, main, nav, section {
pading: 0;
margin: 0;
}
body {
background-color:#777;
width:960px;
margin-left:auto;
margin-right:auto;
}
Etc ...
Example Two Using Classes all the through the html file for reference in the css file
<body class="body"> on the html file which is then used to style via .body on the css { example}
.body {
background-color:#777;
width:960px;
margin-left:auto;
margin-right:auto;
}
Etc….
After this he goes onto add a class to nearly every thing, article, aside, footer, header, main, nav, section
So i am wondering if the top example where most is done within the page tags is normally used or is it better practice to be adding a class to all the page tags ( article, aside, footer, header, main, nav, section) as i construct a webpage,