HTML, Margins, and Spacing

If the text is too close to a screen edge, you can set the margins (left and right) to size and create spacing.

Programmazione HTML
Programmazione HTML

Let’s see how to set these margins using the following tags. Margin settings are expressed in pixels.

Now let’s set the margins for our text:


 

  • Here is my first text

 

We have become acquainted with the margin tag, using it for the top top and left left borders.

Now let’s do a test:
open the online editor and paste the example code shown above into the top part of the editor.
Try varying the pixel numbering for the margins, and you will see the text line move by the amount you have set.

If we wanted to increase the spacing between a sentence, a letter, or a paragraph, we need to use the tag tag, which allows us to increase this space.

Here is the usage of tag

Here is my first text    Here is the first text again

You will notice that the space between the two sentences is considerable. You can insert this tag multiple times, as many times as needed depending on how much space you want to create.

Let’s now see the usage of tag with paragraphs:


 

Here is the first text

Here is the second text

Here is the third text

 

 

 

You will notice a clear spacing between one paragraph and another, which you can increase by inserting more tag tags.

Unlike other tags, this one does not require opening and closing tags, as the Browser will still identify the space you intend to allocate to your text or paragraph.

Pubblicato in

Se vuoi rimanere aggiornato su HTML, Margins, and Spacing iscriviti alla nostra newsletter settimanale

Be the first to comment

Leave a Reply

Your email address will not be published.


*