0Pricing
HTML for Kids · Lesson

Introduction to CSS

Introduction to CSS

Introduction 1

Hi,

In the previous chapter, we learned what CSS is and why we should use it. Now I want to make a quick introduction with a simple example.

Let's define a simple HTML page.

<html>
<body>
		<h1>Hello CSS</h1>
</body>
</html>

Inline Style

Now, let's want to change the color of our Hello CSS header to red. For this, we will use the style attribute that can be added to almost any HTML tag. 

With this attribute, we can define a style in each element as inline.

When we look at the preview section, we will see that the color of the header turns red.

color: red;

We have painted the font color of the element with a style definition.

<h1 style="color:red;">Hello CSS</h1>
← Back to HTML for Kids