HTML TutorialLesson 8Free preview
HTML Styles
This lesson is part of HTML · All levels
Summary
Styles on HTML elements can be directly assigned through attribute style with the property: value pattern. Some commonly used examples of properties are color for text color, background-color for background color, and font-size for font size. While it can be used for learning, neat styling should be transferred to external CSS.
Key points
- Inline style is written with the attribute style="property: value"
- Common property: color, background-color, font-size, text-align
- The inline style adheres to one element and is difficult to maintain
- For a real project, move the style to a separate CSS file
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.