Home > DeveloperSection > Forums > Offset bullet image in UL using CSS
Manoj Bhatt
Manoj Bhatt

Total Post:153

Points:1079
Posted on    August-19-2013 7:05 AM

 CSS-CSS3 CSS-CSS3 
Ratings:


 1 Reply(s)
 1165  View(s)
Rate this:
Hi developers!

In my unordered list, I use an image for the bullet but the bullet appears aligned with the bottom of the text to the right of it. I would like to have it positioned in the middle of the text's height. Is there some way in css to center or add an offset to the bullet?

<ul>

  <li>item 1</li>

  <li>item 2</li>

</ul> 

ul

{

  list-style-image: url('/images/bullet_blue_8x8.png');

}

thanks in advance




shreesh chandra shukla
shreesh chandra shukla

Total Post:105

Points:735
Posted on    August-19-2013 8:23 AM

Hi Manoj!
try this

ul{

     margin:0;

     padding:0;

     list-style:none;

    }

li {

    background:url("/images/bullet_blue_8x8.png") no-repeat 0 -2px;

    padding-left:18px;

    font-size:12px;

    } 

You need to use background-image.


Don't want to miss updates? Please click the below button!

Follow MindStick