css - 如何添加 CSS 重复 y 以使边框垂直
问题描述
需要垂直对齐 css 生成的边框...我如何使用background-repeat: repeat-y这里:
.container::after {
position:absolute;
bottom: -50px;
left: 0px;
width: 100%;
content:" ";
background:
radial-gradient(circle at 50% 0%, white 25%, #535353 26%, gray 40%);
background-color: gray;
background-size:50px 100px;
height:50px;
background-repeat: repeat-x;
}
谢谢
解决方案
您需要将垂直值转换为水平值,反之亦然:
.container {
position: relative;
width: 50%;
height: 100vh;
}
.container::after {
position: absolute;
right: -50px; /* bottom: -50px; */
top: 0; /* left: 0 */
width: 50px; /* width: 100% */
height: 100%; /* height: 50px; */
content: "";
background: radial-gradient(circle at 0% 50%, white 45%, #535353 46%, gray 60%);
background-color: gray;
background-size: 50px 50px; /* background-size: 50px 100px; */
background-repeat: repeat-y; /* background-repeat: repeat-x; */
}
<div class="container"></div>
推荐阅读
- azure - 使用 Azure Web API 应用程序中的 C# 从 Azure Data Lake 查询 parquet 数据
- jquery - 如何更改详细信息控件类名图标的颜色
- c# - 在c#循环中运行x个线程
- javascript - 从对象中删除深层项目
- lua - 迭代时更新表值
- c# - 为什么这条线分支好像布尔条件解析为真?
- kotlin - Kotlin fun 参数传递给另一个函数,然后返回
- android - 如何为多个函数调用返回相同的运行 observable?
- python - 系统地重新布线功能
- sql - SSDT 项目部署后问题,当使用 Merge 和“WHEN NOT MATCHED By SOURCE THEN DELETE”播种具有外键约束的表时