风格twitter bootstrap导航栏无法应用样式到折叠的导航栏?

问题描述:

我应用了一些样式到twitter bootstrap navbar,然后意识到我不想要这些在折叠版本。我首先寻找一些应用类来区分折叠和未折叠的栏,但我找不到一个。我将尝试使用JS有条件地添加一个类...是否有更好的方法来做这个?

I applied some styles to the twitter bootstrap navbar, and then realised I didn't want these on the collapsed version. I first looked for some applied class to differentiate between a collapsed and uncollapsed bar, but I can't find one. I am going to try to use JS to add a class conditionally ... is there a better way to do this?

在媒体查询中封装您的样式,例如bootstrap:

Wrap your styles in a media query, like bootstrap does:

@media (min-width: 980px) {
    /* your conditional CSS*/
}