Basic Styling Challenge
Part of the Styling with CSS section of Coddy's HTML journey — lesson 9 of 76.
Challenge
EasyYou 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:
- Use inline CSS to change the text color of the
<h1>heading to blue. - Use internal CSS to change the background color of the
bodyto lightgray and the font size of the paragraph (<p>) to 16px. - Use the given external CSS file named
styles.cssto change the text color of the paragraph (<p>) to red. - 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
5 Colors and Backgrounds
Background ColorHEX ColorsRGB ColorsTransparency with RGBARecap Challenge #1