Home > Software design >  When attempting to apply the class attribute to a paragraph, the text remains black instead of the a
When attempting to apply the class attribute to a paragraph, the text remains black instead of the a

Time:09-16

Here is my information

    
    .error{
        color:rgb(20, 213, 220);
    }
    <!DOCTYPE html>
    <html>
    <head>
        <link rel="stylesheet" href="styles.css">
        <title>CSS Basics</title>
    </head>
    <body>
    
        <div>
            <p >abcdefghijklmnopqrstuvwxyz</p>
            <p>12345678901234567890123456</p>
            <p>doremifasolatidodotilasofa</p>
        </div>
    
    </body>
    </html>

CodePudding user response:

Add css in style tag

    <!DOCTYPE html>
<html>
<head>
    <link rel="stylesheet" href="styles.css">
    <title>CSS Basics</title>
</head>
<body>

    <div>
        <p >abcdefghijklmnopqrstuvwxyz</p>
        <p>12345678901234567890123456</p>
        <p>doremifasolatidodotilasofa</p>
    </div>

</body>
</html>
<style>
.error{
    color:rgb(20, 213, 220);
}
</style>

CodePudding user response:

Oh my bad! I fixed it---I had just forgotten to put the styles.css file in the same folder as my .html file, haha '^_^ my bad

  • Related