
批改狀態(tài):合格
老師批語:寫的不錯(cuò),繼續(xù)加油。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>元素屬性的樣式規(guī)則</title>
</head>
<style>
#title-id
{
color:violet;
font-size:20px;
}
.title-Class
{
color:darkgreen;
font-size:18px;
}
#title-h
{
font-weight: bold;
}
.title-h
{
color: darkgoldenrod;
padding-left: 15px;
}
</style>
<body>
<p id="title-id">ID元素的樣式,字體顏色violet,字體大?。?0像素</p>
<p class="title-Class">Class元素的樣式,字體顏色darkgreen,字體大小:18像素</p>
<p style="color: darkred; font-size: 16px;">Style元素的樣式,字體顏色darkred,字體大?。?6像素</p>
<p id="title-h" class="title-h" style="background-color: black; height:50px; line-height:50px;">三個(gè)元素樣式混搭,ID元素:粗體字,Class元素:顏色:darkgoldenrod,填充15個(gè)像素,Style元素:背景黑色,行高50像素,文本垂直居中</p>
</body>
</html>
微信掃碼
關(guān)注PHP中文網(wǎng)服務(wù)號
QQ掃碼
加入技術(shù)交流群
Copyright 2014-2025 http://ipnx.cn/ All Rights Reserved | php.cn | 湘ICP備2023035733號