How to Reduce Line Spacing in HTML Codes

How to Reduce Line Spacing in HTML Codes thumbnail
Using CSS coding can reduce line spacing in your HTML document.

When you insert text into a Web page, the design principles that you follow to create solid print design still apply. Generally speaking, you do not want to include large blocks of text that make it difficult for readers to follow what is written. However, there are occasions when you may want to reduce the amount of space between some of the lines in your HTML code. You can add some CSS coding to your HTML document to reduce the amount of spacing located between lines on the page.

Instructions

    • 1

      Double-click the HTML document file to open it.

    • 2

      Click your cursor in the "<head>" section of the document and insert this code:

      <style type="text/css">

      p.linesize {line-height:80%;}

      </style>

    • 3

      Replace "80%" with the percentage of space you want between lines in the text. The default percentage for most Web pages is around 110 percent, so to reduce spacing you likely want to have this number at least less than "110%."

    • 4

      Scroll down to the section of the document where the <body> tag appears. This is the section where all your text is included.

    • 5

      Insert this tag at the top of the text:

      <p class="linesize">

    • 6

      Publish the page.

Related Searches:

References

Resources

  • Photo Credit Comstock/Comstock/Getty Images

Comments

Related Ads

Featured