Jump to content

How to align li lists


newcoder1010

Recommended Posts

Hi,

 

I have this html:

<li >llllllllll</li>
<li >llllllllll</li>
<li >llllllllll</li>
<li >llllllllll</li>

I would like to align li to left. When I align using below code, bullets and texts both align to left for 2nd line. If the bullet point requires a second line, how to have it aligned with the text above and not the actual bullet. Please see the image. Can you please help?

.coaching-program li {
    bottom: 5px;
    text-align: left;
}

post-168746-0-74905700-1476568189_thumb.png

Edited by newcoder1010
Link to comment
Share on other sites

I tried this and it looks lot better but I still have some indent issues in different browsers, specially for mobile versions. Some devices show the 2nd line is being more indented than the first line. Please advise. Attached image.

 

.coaching-program li {    list-style-type: disc;    list-style-position: inside;    text-indent: -1.5em;    padding-left: 1em;}

post-168746-0-94393000-1476638525_thumb.png

Edited by newcoder1010
Link to comment
Share on other sites

IF text-indent: is causing the problem, it will cause first line of text to move to right, any line following the first will be further to the left beyond the indentation, using text-indent:0; will set it so no indentation occurs. IT should then return to normal with text lining up to padding already present.

Link to comment
Share on other sites

.coaching-program li {    list-style-type: disc;    list-style-position: inside;    text-indent: 0;    padding-left: 1em;}

I tried with text indent 0. I did lot of google I can not fix the problem. Some browsers/devices show first and 2nd line aligned correctly some don't. Can you please help me with the code?

 

Should I also rewrite the html?

Link to comment
Share on other sites

Usually because different browser use different styling values, you would zero everything, including ul,ol, li elements.

 

ul, ol, li {list-syle-type: none; text-indent: 0; padding: 0; margin: 0;}

 

Then you add required styling, so it will be the same in all browsers.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...