【发布时间】:2021-10-16 17:28:46
【问题描述】:
div {
background-color: #ccc;
width: 100%;
color: #ffffff;
}
div > div {
background-color: #000;
width: 80%;
margin: auto;
}
h1::before {
content: '';
display:block;
height: 30px; /*height of icon */
width: 30px; /*width of icon */
border-radius: 15px;
color: #fff;
position: absolute;
left: 5%;
margin-top: 30px;
/*background */
background: #ffffff no-repeat 0px 0px;
}
<div><div><h1>Für Designer, Schriftsetzer, Layouter, Grafikenthusiasten und alle anderen</h1><div><div>
上面的示例代码在 another 中使用 a 。实际代码使用另一个容器内的布局。所以截图中的点和线元素在那个容器之外。
点当前显示为伪元素。我可以显示圆圈,但我也想在它的左侧创建线条。需要将行的左端拉伸到浏览器的左边缘。
谢谢
【问题讨论】:
-
对于你的外部
<div>,我会使用<header>。然后将::after伪元素应用到<header>。
标签: javascript html jquery css pseudo-element