HTML Styles

So far, you’ve got tags like <p> and <h1> making your webpage functional—but what if you want it to look good too? That’s where HTML styles come in. Before you dive into full-on CSS (that’s a whole other adventure), you can use the style attribute to add a splash of personality directly in your HTML. It’s like giving your tags a quick makeover!

The style attribute works by slipping into any opening tag, followed by some rules in the format property: value.

For example:

<p style="color: blue;">This text is blue!</p>

Load that in a browser, and the text turns blue. Easy, right? You’re telling the paragraph, “Hey, make your color blue.”


Here are a few tricks to try:

  1. Color: Change text color with color: red; or color: #00FF00; (that’s green in hex code).
  2. Font Size: Bump it up with font-size: 20px; for bigger text.
  3. Background: Add a backdrop, like background-color: yellow;.

You can even mix them:

<h2 style="color: purple; font-size: 24px;">A Fancy Heading</h2>

Now your heading’s purple and a little larger—perfect for grabbing attention.

The catch? You add styles one tag at a time, so it’s great for small tweaks but gets clunky for big projects. That’s when CSS takes over (we’ll get there later). For now, think of this as your playground—experiment with a paragraph or two. Maybe:

<p style="background-color: lightgray; color: darkgreen;">Look at me, standing out!</p>

It’s a light gray box with dark green text. Mess around with colors and sizes to see what sticks.


One thing: keep it simple at first—too many styles in one tag can feel like overdecorating a room. Play a little, check it in your browser, and watch your page go from basic to bold

How-To Guides for HTML

No How-To Guide is available right now.

Keep Learning & Level Up!

Enhance your HTML skills with our in-depth tutorials and interactive quizzes.

Explore HTML Quiz