我正在尝试将标题固定在移动设备上(使用chrome inspect将其固定在1024px以下的任何图片。我将图片设置为“包含”,以便可以看到完整宽度,但是在此之前和之后都留下了灰色条,我希望直接流过,就像在照片中一样。如果我将突出显示的黄色圆圈中的两个都删除,则可以使用。是否可以使用其他CSS执行此操作?我尝试了以下操作,但无法正常使用。.
Sitelink enter link description here
.page-header .style {
/* min-height: 667px; */
}
@media (max-width: 991px)
.carousel .page-header {
/* padding: 0 30px; */
}
更新 当我取消选中
element.style {
min-height: 667px;
}
这变为活动状态:
@media (max-width: 768px)
.home:not(.blog) .page-header {
min-height: 0;
}
更新,我有这段代码包含@ 1024px的图片:
@media (max-width: 1024px) {
.header-filter {
background-size: contain;
background-repeat: no-repeat;
}
}
答案 0 :(得分:0)
添加此内容:
min-height:initial;
用于填充
padding: initial;
答案 1 :(得分:0)
答案 2 :(得分:-1)
尝试在要覆盖的属性中添加!important
如果您要添加其他CSS,请尝试添加
@media (max-width: 768px)
.home:not(.blog) .page-header {
min-height: 0 !important;
}
有关更多信息-> https://css-tricks.com/when-using-important-is-the-right-choice/
答案 3 :(得分:-1)
尝试使用此CSS:
@media (max-width: 991px)
.carousel .page-header {
padding: unset !important;
min-height: unset !important;
}
答案 4 :(得分:-1)
尝试调试。一次上一堂课,看看哪一堂课没用。