Unable to float a twitter bootstrap navbar item right with either class=pull-right or float:right

前端 未结 6 466
礼貌的吻别
礼貌的吻别 2021-02-04 09:37

I am using Twitter bootstrap and Rails and I can\'t seem to float a navbar item to the right.

I tried using something like this:

  • 6条回答
    •  佛祖请我去吃肉
      2021-02-04 10:29

      have you tried being more specific with your CSS?

      .navbar ul.nav li.whoami {
          float:right;
      }
      

      Sometimes if the prior CSS (bootstrap in this case) is very specific, it requires the same level of specificity (or greater) to override it.

      Might be helpful to post a jsfiddle. Screenshots are difficult to debug ;)

    提交回复
    热议问题