css中标志点怎么打

CSS中标志点的打法

在CSS中,标志点的使用非常广泛,比如列表、导航栏、分割线等等,下面介绍一下如何打出常用的标志点:

css中标志点怎么打

1. 列表标志

ul {
  list-style-type: disc; /* 实心圆点 */
  list-style-type: circle; /* 空心圆点 */
  list-style-type: square; /* 实心方块 */
  list-style-type: none; /* 取消标志 */
}

2. 行内标志

a::before {
  content: "●"; /* 实心圆点 */
  content: "〇"; /* 空心圆点 */
  content: "■"; /* 实心方块 */
}

3. 分割线标志

hr {
  border: none;
  border-top: 1px solid #ccc; /* 灰色实线 */
  border-top: 1px dashed #ccc; /* 灰色虚线 */
  border-top: 1px dotted #ccc; /* 灰色点线 */
}

4. 导航栏标志

nav ul {
  list-style-type: none;
  display: flex;
}

nav li {
  margin-right: 20px;
  position: relative;
}

nav li::before {
  content: "";
  display: block;
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 0%;
  height: 2px;
  background-color: #ccc; /* 灰色实线 */
  background-color: #666; /* 灰色实线 */
  background-color: #f00; /* 红色实线 */
}

nav li:hover::before {
  width: 100%;
}

相关文章

Css常用的排序方式权重分配 排序方式: 1、按类型 ...
原文:https://www.cnblogs.com/wenruo/p/9732704.html 先上...
css属性:word-wrap:break-word; 与 word-break:break-all 的...
https://destiny001.gitee.io/color/
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML...
css之background的cover和contain的缩放背景图 对于这两个属...