1.1 Demonstrate knowledge of HTML and CSS
Last updated
Last updated
Review CSS selector precedence.
HTML- HyperText Markup Language and CSS - Cascading Style Sheets as defined by are the two core fundamental technologies for building websites.
HTML is the structure and CSS defines the visual layout.
With HTML, authors describe the structure of pages using markup. The elements of the language label pieces of content such as “paragraph,” “list,” “table,” and so on.
is the order in which CSS styles will apply to your HTML markup.
Precedence is evaluated according to these rules:
Inline CSS takes precedence over any other CSS (outdated form of styling, typically still used in email templating).
More specific selectors take precedence over less specific ones.
ID selectors take precedence over class selectors.
For Example:
#header
would take precedence over .head-section
(because ID selectors take precedence over class selectors)
#header.head-section
would take precedence over #header
(because more specific selectors take precedence over less specific ones)