当前位置: 首页 > 工具软件 > XCSS > 使用案例 >

用css写一个关闭的“X”

邓光赫
2023-12-01

html 代码

<div class="removes" title="关闭"></div>

css 代码

.removes {
  position: absolute;
  right: 0;
  top: 0;
  color: #999;
  cursor: pointer;
  padding: 5px 10px;
}

.removes::before {
  content: "\2716";
  display: inline-block;
  transition: all 0.4s;
  transform: rotate(0deg);
}

.removes:hover::before {
  color: #2c3e50;
  transform: rotate(90deg);
}

 类似资料: