Untitled
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>CSS Class Application</title> <style> /* Style for div.A */ div.A { background-color: black; padding: 20px; border: 2px solid red; color: chartreuse; text-align: center; } /* Style for div.B */ div.B { background-color: blueviolet; border: 2px solid blue; padding: 30px; text-align: right; } </style> </head> <body> <!-- Apply class A to this div --> <div class="A"> This is a div with class A </div> <!-- Apply class B to this div --> <div class="B"> This is a div with class B </div> </body> </html>
Leave a Comment