March 2018
Beginner to intermediate
514 pages
13h 11m
English
ID selectors overcome the problem of general styling, by selecting elements by their id. Element IDs have the benefit, but also the restriction, that they need to be unique in the HTML:
<!DOCTYPE html><html><head>#mainparagraph { color: red;}</head><body><p>This is a styled paragraph.</p><p id="mainparagraph">This is a styled paragraph.</p></body></html>
The previous example will style only one paragraph based on the id.
Read now
Unlock full access