CSS Bootstrap Carousel 标题顶部对齐?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21213154/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Bootstrap Carousel Caption Top Alignment?
提问by user3211386
I'm not trying to do anything too fancy here, but instead of the Bootstrap Carousel Captions defaulting to aligning to the bottom of the Carousel, how do I get them to default align to the top?
我不想在这里做任何太花哨的事情,而是 Bootstrap Carousel Captions 默认对齐到 Carousel 的底部,我如何让它们默认对齐到顶部?
回答by koala_dev
Add this to your css to change the element position:
将此添加到您的 css 以更改元素位置:
.carousel-caption {
top: 0;
bottom: auto;
}
See demo fiddle
回答by brroshan
You could also:
你也可以:
.carousel-caption {
position: absolute;
top:-40px
}