HTML Code for No Spacing Between Sentences

104 17

    Impact of "word-spacing" and "letter-spacing"

    • One of the two ways of using HTML code to set the spacing between sentences is to set the "word-spacing" property of the element you want to space. Specifying a value for this property impacts the amount of whitespace appearing between all words in the paragraph, div, anchor or other element you're setting the style for. For example, this style definition makes the space between all words in all paragraphs in the HTML page 20 pixels:

      P { word-spacing: 20px;}

      The other approach to customizing the amount of space between sentences is to set the "letter-spacing" property of an element. Note that setting this property will expand or contract all letters in the affected sentence, which may make those sentences difficult to read. This style definition sets the spacing between letters at five pixels.

      .wideSpacing { letter-spacing: 5px; }

    Sample Web Page

    • Test out custom sentence spacing in a Web page by writing a sample Web page, one using custom style definitions for the "word-spacing" and "letter-spacing" properties. Start this project with a blank Web page template, such as the one at the end of this section.

      <html>
      <head>
      <style>
      </style>
      </head>
      <body>
      </body>
      </html>

      Save your Web template as a plain text document with any filename ending in "HTML" or "HTM."

    Define Styles

    • Once you've made a blank Web page to host your sentence-spacing experiments, define custom styles for the page, in the Style section of your Web template. The style definitions following this section create custom styles that impact word spacing and letter spacing. Any element in your Web page will be able to use these customizations. Once you've set an element's Class property to the name of one of the following definitions, the element will take on the sentence spacing you've specified for that definition.

      .myWordSpacing { word-spacing: 10px; }
      .myLetterSpacing { letter-spacing: 20px; }

    Apply Defined Styles

    • After creating custom style definition that impact sentence spacing, apply them to elements on your Web page. Start by writing text whose sentence spacing you want your custom definitions to change. For example, you may write a paragraph element with two simple sentences.

      <p >Jack and Jill went down the mound. And nevermore were they found. </p>

      After writing the sample sentences for an element, change sentence spacing by customizing its style. Do so by changing the element's Style property, or by changing its Class property.

      <p class="myWordSpacing">Jack and Jill went down the mound. And nevermore were they found. </p>

      <p class="myLetterSpacing"> Jack and Jill went down the mound. And nevermore were they found. </p>

Subscribe to our newsletter
Sign up here to get the latest news, updates and special offers delivered directly to your inbox.
You can unsubscribe at any time

Leave A Reply

Your email address will not be published.