css - 我如何添加 CSS repeat y 使边框垂直

标签 css

需要垂直对齐 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>

关于css - 我如何添加 CSS repeat y 使边框垂直,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59108611/

相关文章:

html - 横幅图像放置和比例

javascript - 通过下拉选择器angularjs更改动画图像

css - 如何将这两个元素对齐在同一行中?

html - 在具有动态高度的 div 中垂直居中图像

php - 如何将多个动态生成的文本框值显示到数组中

javascript - grunt sass 任务不起作用?

javascript - 使用可拖动的 jQuery 方法并隐藏 div 上的滚动条?

html - 如何在悬停时向 SVG 内的路径元素添加阴影

javascript - 当 div 具有特定类时更改元素 css

html - 给 mat-table 一个高度并使 mat-row 可滚动