Home >Web Front-end >CSS Tutorial >How to Remove Indentation from Unordered List Items?

How to Remove Indentation from Unordered List Items?

Mary-Kate Olsen
Mary-Kate OlsenOriginal
2024-11-22 10:56:11482browse

How to Remove Indentation from Unordered List Items?

Removing Indentation from Unordered List Items

While attempting to remove indentation from a

    , setting the margin, padding, and text-indent properties to 0 proved ineffective. It was discovered that setting text-indent to a negative value can achieve the desired result. However, is this the only viable solution?

    The Solution

    The suggested approach involves resetting both the list style and left padding to no value.

    CSS Code:

    ul {
      list-style: none;
      padding-left: 0;
    }

    Example:

    <ul>
      <li>a</li>
      <li>b</li>
      <li>c</li>
    </ul>

    The above is the detailed content of How to Remove Indentation from Unordered List Items?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn