gpt4 book ai didi

html - 编辑 : How do you make a container fill the width of bootstrap col class?

转载 作者:行者123 更新时间:2023-11-28 01:26:52 24 4
gpt4 key购买 nike

我正在使用 bootstrap 和 hover.css 创建一个列表组,其中列表组项是按钮。问题是我无法将这些元素的宽度设置为仅填充其父项的空间。

编辑:问题实际上并不是按钮在容器外。这是列外的容器

在我的 html 中,我目前有:

<div class="col-md-4">
<div class="list-box">
<div class="container">
<h1>Some title</h1>
<div class="list-group">
<button type="button" class="list-group-item hvr-sweep-to-left" ng-repeat="project in currentUser.projects">
{{Something}}
</button>
</div>
</div>
</div>
</div>

在我的 css 中,我目前有:

.list-box 
{
background-color: #FFFFFF;
border-color: #000000;
display: block;
}

.list-group-item
{
display: block;
width: 100%;
}

这是我正在使用的 hover.css

/* Button Effect - Sweep To Left */
.hvr-sweep-to-left {
display: block;
vertical-align: middle;
-webkit-transform: translateZ(0);
transform: translateZ(0);
box-shadow: 0 0 1px rgba(0, 0, 0, 0);
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
-moz-osx-font-smoothing: grayscale;
position: relative;
-webkit-transition-property: color;
transition-property: color;
-webkit-transition-duration: 0.3s;
transition-duration: 0.3s;
}
.hvr-sweep-to-left:before {
content: "";
position: absolute;
z-index: -1;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: #4393b9;
-webkit-transform: scaleX(0);
transform: scaleX(0);
-webkit-transform-origin: 100% 50%;
transform-origin: 100% 50%;
-webkit-transition-property: transform;
transition-property: transform;
-webkit-transition-duration: 0.3s;
transition-duration: 0.3s;
-webkit-transition-timing-function: ease-out;
transition-timing-function: ease-out;
}
.hvr-sweep-to-left:hover, .hvr-sweep-to-left:focus, .hvr-sweep-to-left:active {
color: white;
}
.hvr-sweep-to-left:hover:before, .hvr-sweep-to-left:focus:before, .hvr-sweep-to-left:active:before {
-webkit-transform: scaleX(1);
transform: scaleX(1);
}

/* Button Effect - Sweep To Right */
.hvr-sweep-to-right {
display: block;
vertical-align: middle;
-webkit-transform: translateZ(0);
transform: translateZ(0);
box-shadow: 0 0 1px rgba(0, 0, 0, 0);
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
-moz-osx-font-smoothing: grayscale;
position: relative;
-webkit-transition-property: color;
transition-property: color;
-webkit-transition-duration: 0.3s;
transition-duration: 0.3s;
}
.hvr-sweep-to-right:before {
content: "";
position: absolute;
z-index: -1;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: #4393b9;
-webkit-transform: scaleX(0);
transform: scaleX(0);
-webkit-transform-origin: 0 50%;
transform-origin: 0 50%;
-webkit-transition-property: transform;
transition-property: transform;
-webkit-transition-duration: 0.3s;
transition-duration: 0.3s;
-webkit-transition-timing-function: ease-out;
transition-timing-function: ease-out;
}
.hvr-sweep-to-right:hover, .hvr-sweep-to-right:focus, .hvr-sweep-to-right:active {
color: white;
}
.hvr-sweep-to-right:hover:before, .hvr-sweep-to-right:focus:before, .hvr-sweep-to-right:active:before {
-webkit-transform: scaleX(1);
transform: scaleX(1);
}

/* Back Pulse */
@-webkit-keyframes hvr-back-pulse {
50% {
background-color: rgba(32, 152, 209, 0.75);
}
}

@keyframes hvr-back-pulse {
50% {
background-color: rgba(32, 152, 209, 0.75);
}
}

.hvr-back-pulse {
display: inline-block;
vertical-align: middle;
-webkit-transform: translateZ(0);
transform: translateZ(0);
box-shadow: 0 0 1px rgba(0, 0, 0, 0);
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
-moz-osx-font-smoothing: grayscale;
overflow: hidden;
-webkit-transition-duration: 0.5s;
transition-duration: 0.5s;
-webkit-transition-property: color, background-color;
transition-property: color, background-color;
}
.hvr-back-pulse:hover, .hvr-back-pulse:focus, .hvr-back-pulse:active {
-webkit-animation-name: hvr-back-pulse;
animation-name: hvr-back-pulse;
-webkit-animation-duration: 1s;
animation-duration: 1s;
-webkit-animation-delay: 0.5s;
animation-delay: 0.5s;
-webkit-animation-timing-function: linear;
animation-timing-function: linear;
-webkit-animation-iteration-count: infinite;
animation-iteration-count: infinite;
background-color: #2098d1;
background-color: #2098d1;
color: white;
}

最佳答案

我不确定你在找什么。但是,如果您希望列表项填充其父级,则这里是解决方案:

body{width:100%;}
.container
{ background-color: red;
border-color: #000000;
display: block;
padding: 0;
}
h1{font-size:large;}
.list-group-item
{
display: block;
width: 100%;
}

关于html - 编辑 : How do you make a container fill the width of bootstrap col class?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31702547/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com