Is it possible to make an unordered list look like CSS?

Is it possible to make the top unordered list in this image?

alt text

I can not use 2 images for one <li>

If I use the arrows as backgroundand padding-leftit border-bottomwill appear under the image.

I can’t use margin-leftit background-positioneither, probably?

Any ideas?

thank

+3
source share
3 answers

I have downloaded an example for you which you can view and download at: http://joegreen.co.uk/stackoverflow/img-list/img-list.html

Here's the CSS and markup for reference. It has been tested in Firefox 3.6, Safari 4, Chrome, IE7, and IE8.

CSS

#list-container {
    width: 460px;
    padding: 15px 15px 15px 30px;
    background-color: #f6f4ea;
    border: 1px solid #e3e1d5;
    font: 12px Verdana, Geneva, sans-serif;
}

#list-container ul {
    list-style: disc outside url('./bullet.gif');
    margin: 0;
    padding: 0;
}

#list-container ul li {
    margin: 7px 0 0 0;
    padding: 0 0 7px 0;
    border-bottom: 1px dotted #7a7974;
}

HTML:

<div id="list-container">
    <ul>
        <li>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</li>
        <li>Donec tellus felis, euismod non egestas sed, suscipit a leo. Ut quis augue vel mauris mollis volutpat.</li>
        <li>Morbi varius porttitor massa, sed lobortis magna ornare et.</li>
        <li>Fusce blandit risus varius felis posuere vehicula iaculis turpis bibendum. Integer a molestie nunc.</li>
        <li>In blandit neque ac dui laoreet tincidunt dapibus leo pulvinar. Sed nec ligula non orci vulputate vulputate.</li>
    </ul>
</div>
+9

...

http://css.maxdesign.com.au/listutorial/11.htm (. , .)

, , - ( .)

.iconlist
{
list-style: none;
margin: 0;
padding: 0;
}

li.pdf
{
background-image: url(bullet_pdf.gif);
background-repeat: no-repeat;
background-position: 0 50%;
padding: 3px 0 3px 20px;
margin: .4em 0;
}

li.doc
{
background-image: url(bullet_doc.gif);
background-repeat: no-repeat;
background-position: 0 50%;
padding: 3px 0 3px 20px;
margin: .4em 0;
}

li.text
{
background-image: url(bullet_text.gif);
background-repeat: no-repeat;
background-position: 0 50%;
padding: 3px 0 3px 20px;
margin: .4em 0;
}

li.htm
{
background-image: url(bullet_htm.gif);
background-repeat: no-repeat;
background-position: 0 50%;
padding: 3px 0 3px 20px;
margin: .4em 0;
}

HTML CODE
<ul class="iconlist">
<li class="pdf"><a href="#">Milk</a></li>
<li class="text"><a href="#">Eggs</a></li>
<li class="htm"><a href="#">Cheese</a></li>
<li class="doc"><a href="#">Vegetables</a></li>
<li class="text"><a href="#">Fruit</a></li>
</ul>
+3

Using:

list-style-image:url("/images/arrow.gif");

with a field and a border on the sheet.

+1
source

Source: https://habr.com/ru/post/1737789/


All Articles