Id selector syntax
Inside the style sheet, we can access ids with a hash (#). For example, if you gave one of your headings an id, type #Header
to use it as a selector. Selectors allow you to set CSS rules for unique elements, and element types, and classes.
Let's say we want a heading to be displayed in bold on a red background. Use the properties font-weight
and background
and give them respective values. In this case, the CSS rule would look like this:
#Header {
font-weight: bold;
background: rgb(255, 0, 0);
}