css - last separator in list not showing -


i've got horizontal list following.

 <ul>  <li>credits left : 200 usd</li>  <li>items cold : 58</li>  <li>system status : online</li>  <li>sync details : updated </li>  </ul> 

the css following.

  #status ul{ height: 100%; width: 100%; padding:0px 0px 0px 0px; margin: 0px; }  #status li{ float: left; list-style: none; display: block; padding: 20px 10px 20px 10px; color: #dcdcdc; font-size: 14px; font-family:myriadproreg; background: url(../images/header_li_bg.jpg) no-repeat top left; } 

but last element not showing separator image. how can fix this. image explain issue.

result of css

it's not showing last separator because you're using background image on left of menu items (none on right). here 1 way fix using pseudo-elements (ie8+) , absolute positioning.

add these styles:

#status li {     position:relative; } #status li:last-child:after {     display:block;     content:"";     position:absolute;     top:0;     left:100%;     background: url(../images/header_li_bg.jpg) no-repeat top left;      /* width of background image */     width:5px;     /* height of background image */     height:40px; } 

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -