• <...">
    Geek Answers Handbook

    Zero indent for list items.

    My code is structured as follows:

    <article style="font-size:16px;text-indent:40px;line-height:1.5em;">
    <ul>
      <li><a title="Egypt" href="#egypt" style="text-indent:0px;padding-left: -25cm;">Egypt</a></li>
    </ul>
    </article>
    

    and yes, it’s terrible that css should be in html , but don’t worry about it now.

    This will result in Egypt gaining the property text-indent <article>. However, I would like this to not happen. I would like to have 0 text indent in the list item in Egypt!

    How to do it?

    Check js-fiddle .

    +4
    html css text html-lists text-indent
    gsamaras May 28 '16 at 11:22
    source share
    3 answers

    Move text-indent: 0pxto liinstead a, as in the snippet below.

    text-indent . li - , a , , a .

    , , li 40px article. , li "" .

    <article style="font-size:16px;text-indent:40px;line-height:1.5em;">
      <p>
        Goal of this page is to laconically detail where I, <strong>Georgios Samaras</strong> have travelled, since I am asked again and again and usually I forgot some places.
      </p>
      <p>
        I will list (in random order) were I have been to and say some more about the non-Greek places I have been after 2012. It also good to write down the memories... :)
        <ul>
          <li style="text-indent: 0px;"><a title="Egypt" href="#egypt">Egypt</a>
          </li>
        </ul>
    </article>
    Hide result
    +7
    Harry 28 '16 11:26

    , p

    <article>
    <p style="font-size:16px;text-indent:40px;line-height:1.5em;">Goal of this page is to laconically detail where I, <strong>Georgios Samaras</strong> have travelled, since I am asked again and again and usually I forgot some places.
    </p>
    <p>
    I will list (in random order) were I have been to and say some more about the non-Greek places I have been after 2012. It also good to write down the memories... :)
    <ul>
      <li><a title="Egypt" href="#egypt">Egypt</a></li>
    </ul>
    </article>
    
    +4
    Sanjay Achar 28 '16 11:29

    style="(...)" HTML , , -, :

    ul {
        list-style-position: inside;
        padding-left:0;
    }
    

    , .

    +1
    Gytis Tenovimas 28 '16 11:26

    More articles:

    • Apply formula with two different lists - python
    • why are priority queues implemented as a binary heap? - c ++
    • Должен ли я читать из рабыни Redis Cluster? - java
    • Распространение Python script, который зависит от пакета - python
    • R ggplot geom_jitter duplicates outlier - r
    • How to find out what happens when I use Monoid for Map in scalaz - scala
    • How to calculate GCD vectors in GNU Octave / Matlab - matlab
    • не может разрешить метод addDrawerListener (android.support.v7.app.ActionBarDrawerToggle) ' - android
    • Writing a List to a CSV File - c #
    • Using CLI Wercker to build and deploy - command-line-interface

    All Articles

    Geek Answers | 2019