Inline CSS: Inline CSS Hello World

Download as docx, pdf, or txt
Download as docx, pdf, or txt
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

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy