Combine the class value in selector - HTML CSS CSS Selector

HTML CSS examples for CSS Selector:class

Description

Combine the class value in selector

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<style>
p.center {
    text-align: center;
    color: red;
}

p.large {<!-- w w w  .  j  a  v  a2 s  . co m-->
    font-size: 300%;
}
</style>
</head>
<body>

<h1 class="center">This heading will not be affected</h1>
<p class="center">This paragraph will be red and center-aligned.</p>
<p class="center large">This paragraph will be red, center-aligned, and in a large font-size.</p>

</body>
</html>

Related Tutorials