I'm learning HTML from scratch, I have no background with CSS or any web development language, during the tutorial they posted the following exercise:
Add the "intro" class to all <p> elements.
And then I have to change the following code:
<!DOCTYPE html> <html> <head> <style> p.intro { background-color:black; color:white; border:1px solid grey; padding:10px; margin:30px; font-size:150%; } </style> </head> <body> <h1>This is a heading</h1> <p>This is a paragraph.</p> <p>This is a paragraph.</p> <p>This is a paragraph.</p> </body> </html> To solve this, I added the class to each paragraph, but this looks highly inefficient. Is there a way that allows me to add the class to all the paragraphs?