Inline CSS
To style a specific HTML element, you can add the style
attribute directly to the opening tag, like <p>
or <h1>
. This method is called inline styling. After you mention all styles using color
or font-size
properties, make sure to close it with a semicolon (;
).
Inline styling should be your last resort. It messes up with HTML and content, making it harder to read and update. The only time it's justified to use inline styling is having access only to the HTML body.