Currently in the process of creating my inaugural website, which consists of just four pages. Each page follows the standard layout structure with a header, navigation bar, content division (div id="content"), and footer.
As I delve into adding CSS properties to these HTML elements, I find myself utilizing both IDs and classes within the CSS stylesheet. After researching the topic and learning that it's recommended to use both ID and class for an element, I now face the dilemma of determining which CSS properties should be placed in CSS ID rules versus CSS class rules.
To provide context, let's consider a specific CSS rule:
.centered_box{
margin: 0 auto;
width: 960px;
}
Should this rule be applied universally to structural elements such as the header, main content area, and footer? Or would it be more effective to repeat the margin and width properties individually within the CSS ID rules of each structural element?
Your insights on this matter are greatly appreciated.