List Items and Background Images

Today I learned a new trick, instead of using the list-style-image to declare your image in a list like so:ul {list-style-image:url("bullet.gif");} This method is limited in placing your image, because you can\’t move around where it appears. It will appear in place of the bullet and thats it. If you use background inside of the actual li declaration, then instead you can use the padding and margins to place your custom bullet point accordingly.Setup like this:ul {list-style-type:none;}ul li {margin:0px;padding:5px 0px 0px 10px;background: url (bullet.gif);}

No Responses to “List Items and Background Images”




XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

By submitting a comment here you grant Jake Rutter – Front-End Developer and Designer, CSS, JavaScript and jQuery, PHP, Wordpress, Expression Engine, Magento a perpetual license to reproduce your words and name/web site in attribution. Inappropriate comments will be removed at admin's discretion.