【发布时间】:2020-06-12 20:34:10
【问题描述】:
我有以下 sn-p :
.test {
margin-top: 50px;
margin-bottom: 50px;
padding-bottom:7px;
background: /* gradient can be an image */
linear-gradient(
to left,
black 0%,
#FFFFFF 100%
)
left
bottom
#777
no-repeat;
background-size:100% 7px ;/* if linear-gradient, we need to resize it */
}
.test2{
border-bottom: 7px solid black
}
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<div class="test"></div>
<div class="container">
<div class="test2"></div>
</div>
而预期的结果是休闲:
红线是容器开始的地方。我想在容器外制作从 0% 到 100% 的渐变,并在容器内继续使用黑色。这可以实现吗?
【问题讨论】:
-
我不确定我是否理解目标或目的?
-
我要做一个分离,当他遇到容器时渐变应该停止
标签: html css twitter-bootstrap-3