Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 引导程序尝试在容器上放置映像:after&;:之前_Css_Twitter Bootstrap_Less - Fatal编程技术网

Css 引导程序尝试在容器上放置映像:after&;:之前

Css 引导程序尝试在容器上放置映像:after&;:之前,css,twitter-bootstrap,less,Css,Twitter Bootstrap,Less,我试图在容器的左右边缘放置一个带有:before和:after的图像。 但由于某种原因,容器完全。。。。当我把一个绝对位置添加到前后 它可能与容器上的前后标准引导有关 你知道我该怎么做吗 .header, .spotlight, .main, .footer { >.container { position: relative; &:before { content: " "; position: absolute; back

我试图在容器的左右边缘放置一个带有:before和:after的图像。 但由于某种原因,容器完全。。。。当我把一个绝对位置添加到前后

它可能与容器上的前后标准引导有关

你知道我该怎么做吗

.header,
.spotlight,
.main,
.footer {
  >.container {
    position: relative;
    &:before {
      content: " ";
      position: absolute;
      background: url("../img/right.png");
      height: 100%;
      display: block;
      width: 6px;
      right: -6px;
      z-index: 999999;
      top: 0;
    }
    &:after {
      content: " ";
      position: absolute;
      background: url("../img/left.png");
      height: 100%;
      display: block;
      width: 6px;
      left: -6px;
      z-index: 999999;
      top: 0;
    }
  }
}

您不能为容器添加一个容器吗?它可能只会在新容器之前和之后添加另一个容器,如父容器。如果您不使用引导类,请使用您自己的类并为其提供相同的宽度。谢谢!我让它工作了:)