custom list-style-type (in sass)

Angelegt von andi Sun, 29 Aug 2010 16:34:00 GMT

While CSS does allow you to set a custom list-style-type for ul/ol’s with the list-style-image attribute, you can also easily do this by using a background-image with no-repeat and an appropriate padding. This can be useful when list-style-position (allows you to choose whether the list-style-image is IN our OUT of the list-element) is not sufficient for your needs of placing the list-style-image.

In SASS this could look something like this:

<typo:code> ul.teaser_list li

list-style-type: none
padding-left: 35px
background-image: url('/images/icn_check.gif')
background-repeat: no-repeat
background-position: 5px

</type:code>

Trackbacks

Verwenden Sie den folgenden Link zur Rückverlinkung von Ihrer eigenen Seite:
http://praktikanten.brueckenschlaeger.org/trackbacks?article_id=230

Leave a comment

Comments