You are on page 1of 3

Inline CSS

INSTRUCTIONS: Add inline CSS to this paragraph to make the text red.

<!doctype html>
<html>
<head>
<title>Inline CSS</title>
</head>
<body>
<p>Hello World</p>
</body>
</html>

Answer:

<!doctype html>
<html>
<head>
<title>Inline CSS</title>
</head>
<body>
<p style="color:red;">Hello World</p>
</body>
</html>
Internal CSS
INSTRUCTIONS: Update the webpage from the previous exercise to add the styling as Internal CSS and
remove the inline CSS.

<!doctype html>
<html>
<head>
<title>Internal CSS</title>
</head>
<body>
<p style="color:red;">Hello World</p>
</body>
</html>

Answer:

<!doctype html>
<html>
<head>
<title>Internal CSS</title>
<style type="text/css">
p{
color:red;
}
</style>
</head>
<body>
<p>Hello World</p>
</body>
</html>
Classes And Ids
INSTRUCTIONS: Add internal CSS to the following webpage to make the first paragraph red and the
second paragraph blue.

<!doctype html>
<html>
<head>
<title>Classes and Ids</title>
</head>
<body>
<p class="red">This is a paragraph.</p>
<p id="blue">This is another paragraph!</p>
</body>
</html>

Answer:

<!doctype html>
<html>
<head>
<title>Classes and Ids</title>
<style type="text/css">
.red {
color:red;
}

#blue {
color:blue;
}
</style>
</head>
<body>
<p class="red">This is a paragraph.</p>
<p id="blue">This is another paragraph!</p>
</body>
</html>

You might also like