top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Which property is used to add or subtract space between the words of a sentence in CSS?

+1 vote
2,190 views
Which property is used to add or subtract space between the words of a sentence in CSS?
posted Jun 20, 2017 by Sanam

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

The letter-spacing property is used to add or subtract space between the letters that make up a word.

The word-spacing property is used to add or subtract space between the words of a sentence.

The **text-indent ** property is used to indent the text of a paragraph.

Set the Space between Characters

The following example demonstrates how to set the space between characters. Possible values are normal or a number specifying space..

<html>
   <head>
   </head>
   <body>
      <p style="letter-spacing:5px;">
      This text is having space between letters.
      </p>
   </body>
</html>

It will produce the following result −

T h i s t e x t i s h a v i n g s p a c e b e t w e e n l e t t e r s.

Set the Space between Words

The following example demonstrates how to set the space between words. Possible values are normal or a number specifying space.

<html>
   <head>
   </head>
   <body>
      <p style="word-spacing:5px;">
      This text is having space between words.
      </p>
   </body>
</html>

It will produce the following result −

This text is having space between letters.

Set the Text Indent

The following example demonstrates how to indent the first line of a paragraph. Possible values are % or a number specifying indent space.

<html>
   <head>
   </head>
   <body>
      <p style="text-indent:1cm;">
      This text will have first line indented by 1cm and this line will remain at 
      its actual position this is done by CSS text-indent property.
      </p>
   </body>
</html>

It will produce the following result −

This text will have first line indented by 1cm and this line will remain at its actual position this is done by CSS text-indent property.

Note : Use this css in HTML page and test you can seen the difference easily..

answer Jun 22, 2017 by Manikandan J
...