CSS Class Selector

The Web Book

Heading aligned centrally using class selector

Paragraph aligned centrally using the same class selector.


CSS Class Selector Example Code

HTML CODE ................................................................................... <!DOCTYPE html> <html> <body> <h1 class="center">Heading aligned centrally using class selector</h1> <p class="center">Paragraph aligned centrally using the same class selector.</p> </body> </html> CSS CODE ...................... .center { text-align:center; } Back