I am looking for alternative to Non Breaking space in HTML

Raj

In my HTML code whenever I use sentence like below :

<p> This is a example sentence </p> or
 <h3> This is header Sentence </h3>

It is displaying from extreme left side but I want some space before my sentence starts. For this I am using non breaking space. But it looks very ugly since I need to use 5 to 10 times of non breaking space like this :

 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

I tried to use &emsp; also but in this case also i need to use 5 times. So what other options i have to make my sentence to start with some spaces??

Mr. Alien

You can use text-indent property to indent your text inside a p or h3

Alternatively, if you are looking to pad up entire paragraph or header, you should have a wrapper div and use padding or margin for p as well as h3.

But as you said you are using &nbsp; am sure what you are looking for is text-indent.

p.class_name {
   text-indent: 20px;
}

Demo


I've edited your question though, as you only used html tag, I have also added a CSS tag, but if you want a HTML solution than take a look at pre tag

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Is there an alternative to non-breaking space to put space in between text on a line in HTML/CSS?

From Dev

Breaking space (Opposite of non-breaking space)

From Dev

Non breaking space at the end of the line

From Dev

Zlib with non-breaking space

From Dev

non-breaking space in link

From Dev

Zlib with non-breaking space

From Dev

prevent breaking of word with space in html

From Dev

prevent breaking of word with space in html

From Dev

In Go, how can I state I want to match all kinds of space, including the non-breaking one?

From Dev

Inserting a non-breaking space in a @Html.DisplayFor when data is null or empty? ASP.Net MVC

From Dev

Difference between breaking and non breaking space ascii characters

From Dev

How to put a non-breaking space in an NSString?

From Dev

How to append a non-breaking space in a TextBox?

From Dev

Mark space for :after content non-breaking

From Dev

Non breaking space between two elements

From Dev

Chrome JavaScript Errors on Non-Breaking Space

From Dev

Mark space for :after content non-breaking

From Dev

Append non-breaking space behaviour

From Dev

remove (non-breaking) space character in string

From Dev

Non-breaking space not working on Android

From Dev

How can I use a non-breaking space before an inline-block-default element, such as a <button>?

From Dev

What am I looking for in RAM?

From Dev

Is a Javaagent what I am looking for?

From Dev

Convert normal space/whitespace to non-breaking space?

From Dev

non breaking space between labels create a visible space when rendered

From Dev

How to disable non-breaking space with altgr+space

From Dev

Am I breaking strict aliasing rules?

From Dev

What am I looking for to debug this elisp?

From Dev

Is multi dimensional array what I am looking for?

Related Related

  1. 1

    Is there an alternative to non-breaking space to put space in between text on a line in HTML/CSS?

  2. 2

    Breaking space (Opposite of non-breaking space)

  3. 3

    Non breaking space at the end of the line

  4. 4

    Zlib with non-breaking space

  5. 5

    non-breaking space in link

  6. 6

    Zlib with non-breaking space

  7. 7

    prevent breaking of word with space in html

  8. 8

    prevent breaking of word with space in html

  9. 9

    In Go, how can I state I want to match all kinds of space, including the non-breaking one?

  10. 10

    Inserting a non-breaking space in a @Html.DisplayFor when data is null or empty? ASP.Net MVC

  11. 11

    Difference between breaking and non breaking space ascii characters

  12. 12

    How to put a non-breaking space in an NSString?

  13. 13

    How to append a non-breaking space in a TextBox?

  14. 14

    Mark space for :after content non-breaking

  15. 15

    Non breaking space between two elements

  16. 16

    Chrome JavaScript Errors on Non-Breaking Space

  17. 17

    Mark space for :after content non-breaking

  18. 18

    Append non-breaking space behaviour

  19. 19

    remove (non-breaking) space character in string

  20. 20

    Non-breaking space not working on Android

  21. 21

    How can I use a non-breaking space before an inline-block-default element, such as a <button>?

  22. 22

    What am I looking for in RAM?

  23. 23

    Is a Javaagent what I am looking for?

  24. 24

    Convert normal space/whitespace to non-breaking space?

  25. 25

    non breaking space between labels create a visible space when rendered

  26. 26

    How to disable non-breaking space with altgr+space

  27. 27

    Am I breaking strict aliasing rules?

  28. 28

    What am I looking for to debug this elisp?

  29. 29

    Is multi dimensional array what I am looking for?

HotTag

Archive