Question:

I'm making a website and i want to add an indent to the first line of a paragraph how do i do it, simply?

by  |  earlier

0 LIKES UnLike

I'm making a website and i want to add an indent to the first line of a paragraph how do i do it, simply?

 Tags:

   Report

4 ANSWERS


  1. If you want to do it properly, add a class to the first paragraph tag like this:

    <p class="indent">

    Then in the CSS stylesheet (assuming you have one), add this rule:

    .indent {text-indent: 10pt;}

    This method becomes much easier to maintain in the long run, rather than adding a style="text-indent: 10pt" attribute to every paragraph you want to indent.  


  2.      Hit spacebar 5 times


  3. When you put <p> add in 'style="text-indent: 10pt"' so it's like the below..

    <p style="text-indent: 10pt">CONTENT HERE</p>

    And DONT listen to the above answer.  HTML will automatically cancel out multiple spaces.  You can only do one space.

    EDIT: I was assuming that since he/she didn't know about certain styles that they didn't know about CSS.  You can use either one but CSS is easier if you have a stylesheet.

  4. You only have one correct answer and that's the one with text-indent styling.  You can also set a "hanging indent" of a paragraph using negative values. Depending on other styling requirements, the hanging indent may present display problems.  Usually better to use margin with the negative values for same effect.

    Ron

Question Stats

Latest activity: earlier.
This question has 4 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.