Twitter bootstrap 如何在引导中使用媒体屏幕?
我使用背景图像作为导航栏的响应设计Twitter bootstrap 如何在引导中使用媒体屏幕?,twitter-bootstrap,navigation,Twitter Bootstrap,Navigation,我使用背景图像作为导航栏的响应设计 .navbar { background-image: url(http://www.sample.com/images/bg.png); background-repeat: repeat-x; } 我想背景图像关闭在960像素,并使用梯度背景 @media (min-width: 960px) { .navbar { background-image: -webkit-linear-gradient(top, #4f72a8
.navbar {
background-image: url(http://www.sample.com/images/bg.png);
background-repeat: repeat-x;
}
我想背景图像关闭在960像素,并使用梯度背景
@media (min-width: 960px) {
.navbar {
background-image: -webkit-linear-gradient(top, #4f72a8 0%, #040aa5 100%);
background-image: linear-gradient(to bottom, #4f72a8 0%, #040aa5 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient
(startColorstr='#ffffffff', endColorstr='#ffdfdfdf', GradientType=0);
}
}
我得到了梯度,但原始背景图像没有消失。我想你必须在开始时重置背景。这应该对你有用
@media (min-width: 960px) {
.navbar {
background-image: none;
background-image: -webkit-linear-gradient(top, #4f72a8 0%, #040aa5 100%);
background-image: linear-gradient(to bottom, #4f72a8 0%, #040aa5 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient
(startColorstr='#ffffffff', endColorstr='#ffdfdfdf', GradientType=0);
}
}