How to Reduce the Size of the White Space on a New Line in HTML

In an HTML Web page, the amount of white space between lines is typically set to a constant level. If you want to reduce this line spacing, you can do so with a form of HTML called a cascading style sheet, or CSS. This is a small code that is inserted in the HTML file's head section and gives instructions for the rest of the document.

Instructions

    • 1

      Open the HTML file that you want to modify in an editing program.

    • 2

      Enter the following code after the <HEAD> command:

      <style type="text/css">

      p.small { line-height: 100%; }

      </style>

    • 3

      Adjust the line height from "100%" to whatever number you prefer. The smaller the number, the less white space there will be between lines.

    • 4

      Begin every paragraph in the <BODY> section that you want affected with <P CLASS="small"> and end it with </P>. For example:

      <p>

      This is a paragraph with unchanged white space between lines.

      This is a paragraph with unchanged white space between lines.

      This is a paragraph with unchanged white space between lines.

      </p>

      <p class="small">

      This is a paragraph with a smaller white space between lines.

      This is a paragraph with a smaller white space between lines.

      This is a paragraph with a smaller white space between lines.

      </p>

    • 5

      Save the file and open it in a Web browser. Tweak the line space height as needed until you achieve the reduced size that you want.

Tips & Warnings

  • Be careful not to set the line space height so low that your lines overlap each other. This can be hard to read.

Related Searches:

References

Comments

You May Also Like

  • How to Put Your Height on eHarmony

    The website eHarmony is an online dating service that matches users with one another based on a variety of criteria, including personality,...

  • The Standard Size of a Classroom

    From increasing student -teacher interactions to controlling the comfort level, classroom sizes can be a notable factor in contributing to school success....

  • How to Use Line Breaks in HTML

    The line break is a basic part of HTML. Before HTML wizards and add-on technologies, the line break was a real implementer...

Related Ads

Featured