CSS TutorialLesson #8

Add Inline Style

An inline style may be used to apply a unique style for a single element.

Inline CSS

An inline style may be used to apply a unique style for a single element.

To use inline styles, add the style attribute to the relevant element. The style attribute can contain any CSS property.

Example

Example Code

html
Try it Yourself
Live Output Preview:

Tip: An inline style loses many of the advantages of a style sheet (by mixing content with presentation). Use this method sparingly.



Interactive Code Examples

CSS Example 1

html
Try it Yourself
Interactive runnable CSS example from EA Academy.
Live Output Preview: