以下引导程序媒体查询将断点更改为992px(从768px),以便引导程序的默认导航栏崩溃。
@media (max-width: 1200px) { .navbar-header { float: none; } .navbar-left,.navbar-right { float: none !important; } .navbar-toggle { display: block; } .navbar-collapse { border-top: 1px solid transparent; box-shadow: inset 0 1px 0 rgba(255,255,255,0.1); } .navbar-fixed-top { top: 0; border-width: 0 0 1px; } .navbar-collapse.collapse { display: none!important; } .navbar-nav { float: none!important; margin-top: 7.5px; } .navbar-nav>li { float: none; } .navbar-nav>li>a { padding-top: 10px; padding-bottom: 10px; } .collapse.in{ display:block !important; } }当我将上面的内容放在一个单独的文件中并将其链接到bootstrap.css下面的HTML中时,规则不会生效,但是如果我将它直接放在bootstrap.css (最后),那么它就可以了。
anybuddy可以告诉我为什么当我把它放在另一个文件并链接到html时它不适用?
The following bootstrap media queries changes the break-point to 992px (from 768px) for the bootstrap's default navbar's collapse.
@media (max-width: 1200px) { .navbar-header { float: none; } .navbar-left,.navbar-right { float: none !important; } .navbar-toggle { display: block; } .navbar-collapse { border-top: 1px solid transparent; box-shadow: inset 0 1px 0 rgba(255,255,255,0.1); } .navbar-fixed-top { top: 0; border-width: 0 0 1px; } .navbar-collapse.collapse { display: none!important; } .navbar-nav { float: none!important; margin-top: 7.5px; } .navbar-nav>li { float: none; } .navbar-nav>li>a { padding-top: 10px; padding-bottom: 10px; } .collapse.in{ display:block !important; } }When I put the above in a separate file and link it in the HTML below bootstrap.css, the rule does not take effect however if I place it directly in bootstrap.css (at the end) then it works.
Can anybuddy tell me why it doesn't get applied when I put it in another file and linked to html ?
最满意答案
当我将上面的内容放在一个单独的文件中并将其链接到bootstrap.css下面的HTML中时,规则不会生效,但是如果我将它直接放在bootstrap.css (最后),那么它就可以了。
检查<link rel="stylesheet" type="text/css" href="path/custom.css"> 。 这可能是错的。
When I put the above in a separate file and link it in the HTML below bootstrap.css, the rule does not take effect however if I place it directly in bootstrap.css (at the end) then it works.
Check the path of your <link rel="stylesheet" type="text/css" href="path/custom.css">. It's probably wrong.
更多推荐
发布评论