HTML Classes

HTML Class Attribute: For elements with the same class name, the HTML class attribute defines equal styles. Example: <!DOCTYPE html> <html> <head> <style> .fruits { background-color: crimson; color: white; margin: 15px; padding: 10px; } </style> </head> <body> <div class=”fruits”> <h2>Apple</h2> </div> <div class=”fruits”> <h2>Mango</h2> </div> <div class=”fruits”> <h2>Orange</h2> </div> </body> </html> Explanation: In the above … Read more