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
Release: 2024-11-22 10:56:11
Original
479 people have browsed it

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;
    }
    Copy after login

    Example:

    <ul>
      <li>a</li>
      <li>b</li>
      <li>c</li>
    </ul>
    Copy after login

    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!

source:php.cn
Statement of this Website
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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template