Spacing between html paragraphs

3

At first I want to say that I am a beginner in the field, I started to study Information System recently and my question is to do a good job.

using the tag:

<p>primeiro parágrafo</p>
(este espaço precisa ser reduzido)
<p>segundo parágrafo</p>

But my teacher has not yet started the content of CSS and I will not see it before the date of delivery of the work, if there is no solution without the use of CSS I ask you to explain how to do it, because I really have no idea how to enter CSS in html code.

    
asked by anonymous 18.05.2014 / 14:57

2 answers

8

If you are limited to not using CSS, what you could do is use a single paragraph and separate it with a single line break.

So:

<p>primeiro parágrafo<br>segundo parágrafo</p>

Result:

  

first paragraph
  second paragraph

In contrast, using CSS, we have the following: The whole browser adds its own style rules to the common elements. Google Chrome, for example, defines these rules:

p {
  -webkit-margin-before: 1em;
  -webkit-margin-after: 1em;
}

Firefox does this:

p {
  margin-top: 16px;
  margin-bottom: 16px;
}

Visually the effect is the same: add a margin to the <p> element. The simplest and most portable way among different browsers is to use normalize.css . It contains rules for undoing the default rules of all browsers and leaving the style unique. Use this:

<link rel="stylesheet" href="http://necolas.github.io/normalize.css/3.0.1/normalize.css">

Alternatively, you can zero all the margin shapes of the element with this rule:

<style>
  p {
    margin: 0;
  }
</style>

Or applied like this:

<p style="margin: 0;">primeiro parágrafo</p>
<p style="margin: 0;">segundo parágrafo</p>
    
18.05.2014 / 15:08
1
p {
    text-indent: 2em;
    text-align: justify;
}
    
05.01.2017 / 00:05