EN
CSS - remove UL list left margin
4 points
In this short article we would like to show how with CSS remove left margin for UL element (unordered list).
Quick solution:
xxxxxxxxxx
1
/* use following style */
2
3
ul {
4
padding: 0;
5
}
Practicel example
xxxxxxxxxx
1
2
<html>
3
<head>
4
<style>
5
6
ul {
7
border: 1px solid gray;
8
padding: 0; /* <----------------------- required */
9
}
10
11
li {
12
list-style-position: inside; /* <------ optional */
13
}
14
15
</style>
16
</head>
17
<body>
18
<ul>
19
<li>a</li>
20
<li>b</li>
21
<li>c</li>
22
</ul>
23
</body>
24
</html>