CSS
May 2026
CSS (Cascading Style Sheet) is a format used to customise the format of HTML content.
Styles describe how the elements of a markup document should be displayed.
Structure of a CSS style
selector {
property-name: value;
}
Some basic properties
color: the text colourfont-size: the font sizefont-style: the style of the fonttext-decoration: the decorations on the text
Inline Styles
Styles can be defined in the style attribute of HTML tags
External Styles
<head>
<link rel="stylesheet" href="styles.css">
</head>
Cascading
Stylesheets are cascading as many stylesheets can have overlaping rules, the browser give sstyles to elements based on prioeirty:
- inline styles
- document-level styles
- selector specificity
- order of declaration