在这个底部有一张带有一些楼梯的全 Angular 图片。我想让它的高度大约为 500 像素。
它在我设置行内高度时有效:
<section class="pv-40 ding-bottom-clear parallax dark-translucent-bg hovered background-img-4">
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="testimonial" style="height: 500px;">
</div>
</div>
</div>
</div>
</section>
但是当我在 css 中设置高度时它不起作用,我不明白为什么?
<div class="testimonial controlHeight">
</div>
CSS
.controlHeight {
height: 500px;
}
是一个CSS文档,里面有很多行CSS代码,所以叫文档。我想也许有什么东西被覆盖了,所以我尝试将它设置在 CSS 文档的末尾,但仍然没有调用。
最佳答案
controlHeight
是一个类选择器。因此你需要写
.controlHeight {
height: 500px;
}
以点开头。
关于html - 高度内联工作但不是外部 css,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40828164/