W3School TIY
(请在下面的文本框中编辑您的代码,然后单击此按钮测试结果。)
编辑您的代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <style type="text/css"> p[class="important warning"] { color: red; } </style> </head> <body> <h1>可以应用样式:</h1> <p class="important warning">This is a paragraph.</a> <hr /> <h1>无法应用样式:</h1> <p class="important">This is a paragraph.</a> </body> </html>
查看结果: