我正在使用 Bootstrap 5 制作一个网站。在网站的标题中,我使用 Bootstrap 中的轮播作为我的标题。轮播图像还允许显示文本和按钮。我希望图像、文本和按钮具有响应能力。我尝试使用媒体查询,但我不知道该怎么做。
Home |
.c-item {
height: 90%;
}
.c-img {
height: 100%;
object-fit: cover;
filter: brightness(0.6);
}
#team-img {
height: 100%;
object-fit: cover;
}
.c-item {
height: 90%;
}
.c-img {
height: 100%;
object-fit: cover;
filter: brightness(0.6);
}
#team-img {
height: 100%;
object-fit: cover;
}
Home |
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
媒体查询的写法如下:
@media screen and (min-width: 900px) { .carousel-inner{ color:#000; } }我发现在使用bootstrap时,你需要在最后添加!important才能被读取:
@media screen and (min-width: 900px) { .carousel-inner{ color:#000 !important; } }如果想了解更多关于媒体查询的内容,请查看这篇文章:https://www.w3schools.com/css/css3_mediaqueries.asp
(显然,你可能不是想改变字体颜色,这只是一个例子。)