html - Twitter Bootstrap Nav-pills with "notification" not placing as desired -


i trying put "notification" icons in top corner of nav pills, cannot seem them place correctly. when place span in li element makes element larger, , not want behavior. if try put between li elements adds blank space.

the nav pills have styling in addition html , css markup put in jsbin.

in end able place "notification" span in corner(adjustable)

html

  <ul id="contentfirstmenu" class="nav nav-pills">     <li><a href="#viewfulltext">something</a></li>     <span class="notification">5</span>     <li><a href="#inthelibrary">something</a><span class="notification">20</span></li>      <li><a href="#requestacopy">another</a></li>     <li><a href="#requestacopy">another</a></li>   </ul> 

notification css

.notification {     color: #222;     position: relative;     background: #fff;     border: 1px solid #830600;     border-radius: 15px;     -webkit-border-radius: 10px;     -moz-border-radius: 10px;     font-weight: bold;     font-size: 12px;     -webkit-box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.2);     -moz-box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.2);     box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.2);     padding: 0 7px; } 

http://jsbin.com/ohofus/2/edit

seems me easiest thing here put .notification elements inside <li/>s , set positioning. add:

.notification {     top: 0; /* align top....*/ }  #contentfirstmenu > li {     position: relative; /* ensures spans positioned according elements bounds */ } 

as have done here: http://jsbin.com/ohofus/7

hope helps :)


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -