Skip to content Skip to sidebar Skip to footer

What Can I Use To Substitute    In Html?

   is ugly, I think.

Solution 1:

Margin and/or Padding. (css properties), like so:

<pstyle='padding-left : 10px'>Hello</p>

(It's worth noting that it's generally considered bad-practice to put an inline style like that; you typically declare a selector in an external css file and set the class/whatever appropriately.)

Solution 2:

In CSS try:

white-space:nowrap;

Solution 3:

In CSS, Add

pre{
  white-space: pre-wrap;
  white-space: -moz-pre-wrap !important;
  white-space: -pre-wrap;
  white-space: -o-pre-wrap;
}
<pre>
    is not ugly anymore
</pre>

Solution 4:

I had this problem when I realised I will have empty tags. I didn't want to set a fixed height and it was to late to change the html. I wanted to add a space in the css, the substitute for &nbsp, so I added the space before the element, using :before (it needs to be specified via unicode).

p:before {
    content: "\00a0";
}

Hope this solution helps someone. The solution with padding didn't work for my problem.

Solution 5:

&#160; is alternative but it's also ugly

Beautiful solution is available in css.

If u need space at start of paragraph the u can use

p {text-indent: 10px; }

If u need spacing between word use like this

H2 { word-spacing: 3pt }

see here for more options http://www.hypergurl.com/csstutorial7.html

You can give these style to html by inline, external and from in-page(<head>....</head>)

Post a Comment for "What Can I Use To Substitute    In Html?"