代码示例:新闻页面:
1
2
3
4
5
6
Document7
8 body{
9 font-size:16px;
10 font-family:'微软雅黑';
11 line-height:28px;
12 }
13 h1{
14 /*文字不加粗*/
15 font-weight:400;
16 /*让h1里面的文字水平居中对齐*/
17 text-align:center;
18 }
19 .gray{
20 color:#888888;
21 font-size:12px;
22 text-align:center;
23 }
24 a{
25 text-decoration:none;
26 }
27 .search{
28 color:#666666;
29 /*简写:#666666 #66630 #ff00ff #f0f*/
31 width:170px;
32 }
33 .btn{
34 font-weight:700;
35 }
36 p{
37 /*首行缩进两个字的距离*/
38 text-indent:2em;
39 }
40 .pic{
41 /*想要图片居中对齐,则让他的父亲 p标签添加水平居中的代码*/
42 text-align:center;
43 }
44 .footer{
45 color:#888888;
46 }
47
48
49
50
北方高温明日达鼎盛 京津冀多地地表温度将超60℃
51 2019-07-03 16:31 中国天气网
52 搜索
53