CSS基礎教程之尺寸、字體及文字屬性
CSS尺寸屬性
#width:元素寬度,一定要加px單位。
height:元素高度。
#CSS字型屬性
font-size:文字大小。如:font-size:14px;
font-family:字體。如:font-family:微軟雅黑;
font-style:斜體,取值:italic。如:font-style:italic;
font-weight:粗體,取值:bold。如:font-weight:bold;
#CSS文字屬性
- CSS文字屬性
- color:文字顏色
- text-decoration:文字修飾線,取值:none(無)、underline(底線)、overline(上劃線)、line-through (刪除線)
- text-align:文字水平對齊方式,取值:left、center、right
- line-height:行高,可以用固定值,也可以用百分比。如:line-height:24px; line-height:150%;
#text-indent:頭行縮排。如:text-indent:28px;
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>php.cn</title>
<style type="text/css">
h1{
color:red;
width:350px;
text-align:center;
font-family:微软雅黑;
}
p{
line-height:150%;
text-indent:28px;
font-family:楷体;
}
.box{
font-style:italic;
font-weight:bold;
text-decoration:underline;
}
</style>
</head>
<body>
<h1>习近平心中的互联网</h1>
<p>互联网是20世纪最伟大的发明,它正在将人类“<span class="box">一网打尽</span>”,人们在不知不觉中已经融入了互联网生态,互联网让世界变成了“鸡犬之声相闻”的地球村。</p>
</body>
</html>#########
新建檔案
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>php.cn</title>
<style type="text/css">
h1{
color:red;
width:350px;
text-align:center;
font-family:微软雅黑;
}
p{
line-height:150%;
text-indent:28px;
font-family:楷体;
}
.box{
font-style:italic;
font-weight:bold;
text-decoration:underline;
}
</style>
</head>
<body>
<h1>习近平心中的互联网</h1>
<p>互联网是20世纪最伟大的发明,它正在将人类“<span class="box">一网打尽</span>”,人们在不知不觉中已经融入了互联网生态,互联网让世界变成了“鸡犬之声相闻”的地球村。</p>
</body>
</html>
預覽
Clear
- 課程推薦
- 課件下載
課件暫不提供下載,工作人員正在整理中,後期請多關注該課程~ 















