IDs vs Classes: What’s the Difference?

How Are IDs Treated

<footer id = "bottom"> This is a footer. </footer>
#footer {background - color: yellow; margin: auto; padding-bottom: 20%}

How Are Classes Treated

<p class= "sidebar"> Here’s paragraph one. </p>
<p class= "sidebar"> Here’s paragraph two. </p>
<p class= "sidebar"> Here’s paragraph three. </p>
<p class= "sidebar"> Here’s paragraph four. </p>
.sidebar {color: blue; text-align: center; font-weight: 500px;}

Conclusion: General Review on Differences

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store