The results may appear odd due to the border, margin, and padding settings of the floated elements.
When elements are floated, they move up to the top left or right of their container, displacing any existing elements. In your case, the floated elements are pushing "Paragraph 2" to the right because they are floated left. Paragraph 1 has default browser styling with 16px margins on top and bottom, whereas "this is a link" has no margins, allowing it to float higher against the container's top edge.
To align paragraph 1, 2, and "this is a link," consider setting the margin of paragraph 1 to 0 for equal vertical spacing. If you prefer the thick border around paragraph 1, adjust the margins of the other two elements to maintain a 3px space at the top.
p {
margin: 0;
}
.floatL {
float: left;
}
<p id="p1" class="floatL">Paragraph 1</p>
<a href="https://facebook.com" class="floatL"> This is a link </a>
<p id="p2">Paragraph 2</p>
<p>Paragraph 3</p>
Here's an example with a border on Paragraph 1:
p {
margin: 0;
}
#p1, #p2, a {
border: 3px solid black;
}
#p2, a {
border-color: transparent;
}
.floatL {
float: left;
}
<p id="p1" class="floatL">Paragraph 1</p>
<a href="https://facebook.com" class="floatL"> This is a link </a>
<p id="p2">Paragraph 2</p>
<p>Paragraph 3</p>