国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > HTML > 正文

HTML 類

2024-08-26 00:08:34
字體:
來源:轉載
供稿:網友

對 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>

親自試一試

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 上犹县| 汝阳县| 开鲁县| 藁城市| 贵定县| 黑龙江省| 张家川| 井冈山市| 庐江县| 开江县| 刚察县| 隆回县| 梅州市| 册亨县| 乌兰浩特市| 北票市| 元朗区| 普宁市| 峨边| 光山县| 阿图什市| 阳谷县| 彝良县| 涿州市| 东阿县| 调兵山市| 雷州市| 河曲县| 鄂托克前旗| 阳谷县| 军事| 武隆县| 辽中县| 长宁区| 襄城县| 霞浦县| 锡林郭勒盟| 远安县| 阿鲁科尔沁旗| 垦利县| 交口县|