CSS文件
注意改变图片的样式时,是要加给图片所在的标签 比如p
/* 整体 */
body {font: 16px/28px "Microsoft YaHei";
}/* 大标题 */
h1 {font-weight: 600;text-align: center;
}/* 连接a */
a {text-decoration: none;
}/* 时间 来源 */
.scor {font-size: 12px;text-align: center;color: #888888;
}/* 搜索栏文字 */
.search {color: #666;
}/* 按钮 */
.btn {font-weight: 700;
}/* 文本 */
p {text-indent: 2em;
}/* 图片 要加给图片所在的标签 比如p */
.pic {text-align: center;
}
HTML文件
<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title> 练习网 </title><link rel="stylesheet" href="style.css">
</head>
<body ><h1>大标题</h1><div class="scor">时间 网站名 来源:<a href="https://www.baidu.com" target="_blank">百度应该可以了吧</a><input type="text" width="170px" value="请输入搜索内容" class="search"><input type="button" value="搜索" class="btn"></div><hr><p>写了那么多结果审核没过,这是第一段</p><p class="pic"> <img src="images/1.jpg" alt="图片裂了" title="七架飞机"> </p><p>好难受,花了好长时间,结果过不去,这是第二段</p><h4>第一个副标题</h4><p>太难了,我就想找个地方保存一下代码,第三段了</p><p应该就快完了吧,都第四段了</p><p class="pic"> <img src="images/2.jpg" alt="图片裂了" title="好多飞机"> </p><h4>第二个副标题</h4><p>怎么还有两段,已经倒数第二段了</p><p class="pic"> <img src="images/3.jpg" alt="图片裂了" title="竖着排的飞机"> </p><p>终于完了</p></body>
</html>

屈服了













