There is a problem with nesting styles.

<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <style type="text/css"> .t1 p { color: blue; } .p1 { color: red; } </style> </head> <body> <div class="t1"> <p>Абзац 1</p> <p class="p1">Абзац 1</p> <p class="p1">Абзац 1</p> </div> </body> </html> 

those. for class p1, the color is not red. You can replace the class = "p1" with id = "p1", then it will work, but according to the logic, the same id should not be. How to deal with it?

    2 answers 2

    It is enough to make color: red! Important; or think over the structure of not only HTML markup, but also CSS

       <style type="text/css"> .t1 p { color: blue; } .t1 p.p1 { color: red; } </style> 

      I think further understand.