Change the color of all <p> and <h1> elements, to "red". Group the selectors to minimize code. - HTML CSS CSS

HTML CSS examples for CSS:Quiz

Description

Change the color of all <p> and <h1> elements, to "red". Group the selectors to minimize code.

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<style>
h1, p {<!--from w w w .j  a  v  a 2  s  . c  om-->
    color: red;
}
</style>
</head>
<body>

<h1>This is a heading</h1>
<h2>This is a smaller heading</h2>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>

</body>
</html>

Related Tutorials