0

Maybe this is a too basic question.

<p>A long text here A long text here A long text here A long text here A long text here A long text here A long text here A long text here </p>

Is it possible to write something like:

<p>A long text here A long text here A long text here 
  A long text here ...
  ...
</p>

Also, help me tagging this question.

3
  • 3
    Possible in what sense? I mean, you just did it in your question... Commented Jun 11, 2013 at 22:11
  • Are you talking about formatting for viewing in a browser for users? Or are you talking about formatting in code? Commented Jun 11, 2013 at 22:26
  • hmm, I asked a dumb thing, sorry. @Explosion Pills is right. Commented Jun 11, 2013 at 22:37

4 Answers 4

2

Well the paragraph tag removes leading white spaces and ignores enter breaks.

One way to achieve what you want would be to use the Preformatted tag <pre> which returns the result identical to it's base text (with spaces, breaks etc). Another way would be to try styling it with CSS (width, text-indent, etc) in the way it's best representative to the user.

Sign up to request clarification or add additional context in comments.

Comments

1

All of the other answers include some truth, here is a different approach using CSS:
http://jsfiddle.net/Volker_E/p3pgz/

Simply include:

p {
   white-space: pre;
}

This ensures output of white space and line breaks as written in HTML editor. White-Space property description at MDN.

Comments

0

You could simply use the

<br/> tag within the <p> tag for getting the required indentation.. something like <p>A long text here A long text here A long text here <br/> A long text here A long text here A long text here </p>

Comments

0

You can either use &nbsp; a few times, or use CSS:

p {
    text-indent:-20px;
    padding-left:20px;
}

Fiddle

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.