</> Code Corner

HTML · HTML Tutorial · Lesson 8

HTML Styles

Change colors, fonts, sizes and alignment with the style attribute.

The style attribute is used to add styles to an element, such as color, font, size and more.

Example

<tagname style="property:value;">

Background Color

Example

<body style="background-color:powderblue;">
  <h1>This is a heading</h1>
  <p>This is a paragraph.</p>
</body>

Keep reading “HTML Styles”

Sign up to read the full lesson (7 more parts), try every example in the live editor, and take the 5-question quiz.

Chat with us 👋