Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Indent ragged li when using a custom bullet

I'm trying to indent ragged li lines whilst using a custom bullet point, however any minus 'text-indent' solutions I've found online haven't worked - unless I'm missing something.

Would it be possible for someone to take a look at the code below and tell me what I need to add to indent ragged li lines?

.list-icon-pros {
    list-style: none;
    padding-left: 0;
}
.list-icon-pros li:before {    
    font-family: FontAwesome;
    color: #B3B300;
    padding-right: 10px;
    content: "\f00c";
}
like image 741
user3383616 Avatar asked Mar 05 '14 13:03

user3383616


People also ask

How do you indent a Li in HTML?

Like an ordered list element, an unordered list element (<ul>) will indent its list items — or bullet points — by default. If you'd like to change the indentation distance, then you can use the margin-left or padding-left property.

How do I change the indent of a bullet in Word?

Right-click the bullet and select Adjust List Indents in the pop-up menu. In the Adjust List Indents window, change the Bullet position to adjust the bullet indent size or change the Text indent to adjust the text indent size after a bullet.

Why won't my bullets indent in Word?

Go into Word> Preferences> AutoCorrect - AutoFormat as you type to make sure the boxes are checked for Automatic bulleted lists & for Set left- and first-indent with tabs and backspaces.


1 Answers

You could add a negative margin to the pseudo-element or you could use position: absolute.

Position absolute: http://jsfiddle.net/ZwYyL/6/

.list-icon-pros {
    list-style: none;
    padding-left: 20px;
    position: relative;
}
.list-icon-pros li:before {
    font-family: FontAwesome;
    color: #B3B300;
    content:"\f00c";
    position: absolute;
    left: 0;
}

Negative margin: http://jsfiddle.net/ZwYyL/5/

.list-icon-pros {
    list-style: none;
    padding-left: 22px;
}
.list-icon-pros li:before {
    font-family: FontAwesome;
    color: #B3B300;
    content:"\f00c";
    margin:0 5px 0 -22px;
}
like image 75
Mathias Avatar answered Oct 12 '22 08:10

Mathias