Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent text in list from wrapping under icon bullet?

Tags:

html

css

I've built and styled lists before, but this list is made from a Font Awesome font and it's made with a div (it's not global).

I started off this this:

ul.fa-ul2 li:before {
    font-family: FontAwesome;
    content: '\f058';
    color: #6190C3;
    font-size: 28px;
    padding-right: 10px;
    margin-left: -15px;
}

No matter what I have tried, can't get text to stop wrapping under bullet. Also need to get list elements up a little so they line up with font. Here is a link to test site: link to live test site

I've tried "display: inline-block" and "list-style-position: outside" with no luck. I might have had them in the wrong place. Thanks for any suggestions.

like image 880
Andrew Avatar asked Dec 05 '25 12:12

Andrew


1 Answers

add this styles set position:absolute to li:before and li position:relative

ul.fa-ul2 > li{
 position: relative;
}

ul.fa-ul2 li:before {
 position: absolute;
 left: -13px;
}
like image 89
Vitorino fernandes Avatar answered Dec 07 '25 12:12

Vitorino fernandes