HTML CSS examples for CSS Selector:class
Combine the class value in selector
<!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>