Remove Padding from Unordered List

Removing ul indentation with CSS

This code will remove the indentation and list bullets.

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

http://jsfiddle.net/qeqtK/2/

Remove padding from unordered list

It's very simple:

CSS

#dvLinks ul li { display: table-cell; }




RESULTS

Results

How to remove indentation from an unordered list item?

Set the list style and left padding to nothing.

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

ul {  list-style: none;  padding-left: 0;}
<ul>  <li>a</li>  <li>b</li>  <li>c</li></ul>

UL LI how to remove padding?

<p class="has-text-align-justify"><b>List:</b>
<ul style="margin-top:-10px;">
<li> Text1</li>
<li> Text2</li>
<li> Text3</li>
</ul>
</p>

Sorry. Forgot to add the changes

Remove padding from ul in css

Is this what you mean?

#navigation ul{
padding: 0;
}

How to remove list margin?

Just set padding of your ul to 0. Here's a snippet:

ul {    padding: 0;}
ul li { display: inline; list-style: none;}
<ul>  <li>Hey, now I don't have extra space on my left side!</li>  <li>List 2</li>  <li>List 3</li></ul><p>Hi! I am a text without any margin!</p>

Remove indentation from an unordered HTML list

Removing default padding-left (this indention ensures that the markers won't be pushed outside the list ) from ul and custom padding from li should work:

.content ul.searchlist { padding-left : 0; }
.content ul.searchlist li { padding : 10px 0; }

JSFiddle

I need an unordered list without any bullets

You can remove bullets by setting the list-style-type to none on the CSS for the parent element (typically a <ul>), for example:

ul {
list-style-type: none;
}

You might also want to add padding: 0 and margin: 0 to that if you want to remove indentation as well.

See Listutorial for a great walkthrough of list formatting techniques.

Remove left padding from a list (CSS)

The default padding is on the ul element - not the li elements.

ul { padding-left: 0; }

Updated Example

In most browsers, the ul has a default padding-left value of 40px.

ul {    padding-left: 0;    list-style-type:none;}
<ul>  <li>aaaaa</li>  <li>bbbbb</li>  <li>ccccc</li>  <li>ddddd</li>  <li>eeeee</li></ul>

remove space between paragraph and unordered list

You can use CSS selectors in a way similar to the following:

p + ul {
margin-top: -10px;
}

This could be helpful because p + ul means select any <ul> element after a <p> element.

You'll have to adapt this to how much padding or margin you have on your <p> tags generally.

Original answer to original question:

p, ul {
padding: 0;
margin: 0;
}

That will take any EXTRA white space away.

p, ul {
display: inline;
}

That will make all the elements inline instead of blocks. (So, for instance, the <p> won't cause a line break before and after it.)



Related Topics



Leave a reply



Submit