3.5 动手 - 修改更多CSS样式
Last updated
Last updated
在 css 文件夹中添加一个新文件 custom.css
, 并在 index.html 文件中的元素引用,如下图
使用 类选择器、 id选择器 、 派生选择器 给 index.html
中的元素添加样式。
观察 index.html中的文章预览元素(仅截取<div class="post-preview">
标签中的内容):
把 <div class="post-preview">
改为 <div class="container" id="post">
请在 custom.css
中添加下列内容并保存,然后我们来看看CSS中如何使用选择器(注意阅读注释内容):
自己练习更多CSS属性