Class can be used repeatedly on the page,
Because the ID can only appear once on the page, it cannot be reused,
So try to use the class to write, so that you can repeat the CSS you write in the page to reduce the workload andCodeQuantity.
In this case, try to use ID: in the module with a large page, use ID to distinguish different modules.
For example, the page contains such modules as the latest news and recommendation news. You can consider using ID to distinguish.
Another point is that because ID is unique in the page, it is more defined for Javascript in the page.
Supplement: How to Use the class and ID on the page:
Code
Class:
<Style type = "text/CSS">
. Footer { Background : Red ; }
</Style> <Div class = "footer"> footer </div>
ID: <style type = "text/CSS">
# Footer { Background : Red ; }
</Style>
<Div id = "footer"> footer </div>
To define the class CSS, click:".", Such. Footer
CSS that defines the ID uses the"#", Such# Footer