css3类选择器之结合元素选择器和多类选择器用法:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <style> .p2{font-size:30px;} /*结合元素选择器*/ p.p1{color:rebeccapurple;} /*多类选择器*/ .p1.p2{font-style: italic;} </style> </head> <body> <div class="p1">看我</div> <p class="p1">我就是我</p> <p class="p2">我是一段文字</p> <p class="p1 p2">我还是斜体字</p> </body> </html>