Menu
Coddy logo textTech

Basic Styling Challenge

Part of the Styling with CSS section of Coddy's HTML journey — lesson 9 of 76.

challenge icon

Challenge

Easy

You are given an HTML document with a heading (<h1>) and a paragraph (<p>). Your task is to style these elements using a combination of inline, internal, and external CSS. Follow the steps below:

  1. Use inline CSS to change the text color of the <h1> heading to blue.
  2. Use internal CSS to change the background color of the body to lightgray and the font size of the paragraph (<p>) to 16px.
  3. Use the given external CSS file named styles.css to change the text color of the paragraph (<p>) to red.
  4. Link the external CSS file to the HTML document using the <link> tag.

Try it yourself

<html>
<head>
    <title>Basic Styling Challenge</title>
    <style>
        body {
            background-color: white;
        }
        p {
            font-size: 12px;
        }
    </style>
    <!-- Link to external CSS file here -->
</head>
<body>
    <h1 style="color: red;">This is a heading</h1>
    <p>This is a paragraph.</p>
</body>
</html>

All lessons in Styling with CSS