CSS Inline Style Syntax
Multiple Choice Beginner
Question
How do you apply an inline style in HTML?
Hint
Use the style attribute with CSS declarations inside quotes.
Explanation
Inline styles use the style attribute on an HTML element. The syntax is style="property: value;". For example, <p style="color: red;"> makes the text red. Inline styles have the highest specificity, overriding external and internal stylesheets.
Related Resources
Related Lessons
- CSS
Learn CSS styling.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.