风格twitter bootstrap导航栏无法应用样式到折叠的导航栏? [英] Style twitter bootstrap navbar witout applying that styling to collapsed navbar?

查看:144
本文介绍了风格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*/
}

这篇关于风格twitter bootstrap导航栏无法应用样式到折叠的导航栏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆