HTML Àà
¶Ô HTML ½øÐзÖÀࣨÉèÖÃÀࣩ£¬Ê¹ÎÒÃÇÄܹ»ÎªÔªËصÄÀඨÒå CSS Ñùʽ¡£
ΪÏàͬµÄÀàÉèÖÃÏàͬµÄÑùʽ£¬»òÕßΪ²»Í¬µÄÀàÉèÖò»Í¬µÄÑùʽ¡£
ʵÀý
<!DOCTYPE html>
<html>
<head>
<style>
.cities {
background-color:black;
color:white;
margin:20px;
padding:20px;
}
</style>
</head>
<body>
<div class="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>
·ÖÀà¿é¼¶ÔªËØ
HTML <div> ÔªËØÊÇ¿é¼¶ÔªËØ¡£ËüÄܹ»ÓÃ×÷ÆäËû HTML ÔªËØµÄÈÝÆ÷¡£
ÉèÖà <div> ÔªËØµÄÀ࣬ʹÎÒÃÇÄܹ»ÎªÏàͬµÄ <div> ÔªËØÉèÖÃÏàͬµÄÀࣺ
ʵÀý
<!DOCTYPE html>
<html>
<head>
<style>
.cities {
background-color:black;
color:white;
margin:20px;
padding:20px;
}
</style>
</head>
<body>
<div class="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>
<div class="cities">
<h2>Paris</h2>
<p>Paris is the capital and most populous city of France.</p>
</div>
<div class="cities">
<h2>Tokyo</h2>
<p>Tokyo is the capital of Japan, the center of the Greater Tokyo Area,
and the most populous metropolitan area in the world.</p>
</div>
</body>
</html>
·ÖÀàÐÐÄÚÔªËØ
HTML <span> ÔªËØÊÇÐÐÄÚÔªËØ£¬Äܹ»ÓÃ×÷Îı¾µÄÈÝÆ÷¡£
ÉèÖà <span> ÔªËØµÄÀ࣬Äܹ»ÎªÏàͬµÄ <span> ÔªËØÉèÖÃÏàͬµÄÑùʽ¡£
ʵÀý
<!DOCTYPE html>
<html>
<head>
<style>
span.red {color:red;}
</style>
</head>
<body>
<h1>My <span class="red">Important</span> Heading</h1>
</body>
</html>