<html> <head> <style>
.cities { 用.名称{}下形式来定义类的内容及名称 background-color:black; 用#名称{}效果与伤者相同,当用div进行应用时,需id="名称" color:white; margin:20px; padding:20px; } </style> </head> <body> <div class="cities"> div定义块,此处块的样式引用了上面cities类 <h2>London</h2> <p> London is the capital city of England. It is the most populous city in the United Kingdom, with a metropolitan area of over 13 million inhabitants. </p> </div> </body> </html>