Sai prateek
Sai prateek

Reputation: 11906

How to add space before bullet points in HTML

I want to add space before bullet points . My requirement like

This is paragraph1

This is paragraph 2

Any help will be appreciated.

Upvotes: 0

Views: 8462

Answers (5)

Jukka K. Korpela
Jukka K. Korpela

Reputation: 201588

There is spacing before bullet points by default. If there isn’t, you are probably using a “Reset CSS” of some kind.

To set the spacing to a desired value, set padding-left and margin-left of both ul and li elements to zero and then set one of them to the desired value.

Upvotes: 0

Sharanpreet
Sharanpreet

Reputation: 371

apply margin-left to ul

Working Fiddle example is here:

Code:

    [http://jsfiddle.net/Sharan_thethy/MNaUn/][1]

I hope this will help you

Upvotes: 0

Nishan Hitang
Nishan Hitang

Reputation: 805

Try setting margin to li

li{
    margin-left: 20px;
}

JSfiddle here

Upvotes: 1

Gagan Gami
Gagan Gami

Reputation: 10251

You can set CSS to li as per your requirement.

HTML Code

<p>This is my paragraph1</p>
<ul><li> List One </li>
    <li> List Two </li>
    <li> List Three </li>
</ul>
<p>This is my paragraph 2</p>
<ul><li> List One </li>
    <li> List Two </li>
    <li> List Three </li>
</ul>

CSS

li {
  margin-left:1em;
}

JSFiddel

Upvotes: 0

Niels Keurentjes
Niels Keurentjes

Reputation: 41958

CSS:

li {
  margin-left:1em;
}

Upvotes: 0

Related Questions