CSS - remove UL list left margin

4 points
Created by:

In this short article we would like to show how with CSS remove left margin for UL element (unordered list).

Quick solution:

/* use following style */

ul {
    padding: 0;

 Practicel example

// ONLINE-RUNNER:browser;

<!doctype html>

    ul {
      	border: 1px solid gray;
        padding: 0;  /* <----------------------- required */
    li {
      	list-style-position: inside;  /* <------ optional */



Hey 👋
Would you like to know what we do?
  • Dirask is a friendly IT community for learners, professionals and hobbyists to share their knowledge and help each other in extraordinary easy way.
  • We welcome everyone,
    no matter what the experience,
    no matter how basic the question is,
    this community will help you.