Are line breaks the standard way of manipulating the position of HTML elements?


#1

Question

Are line breaks the standard way of manipulating the position of HTML elements?

Answer

The answer to this is dependent on the elements you are trying to position and can become quite involved. For now, just know that in web development there is a design principle called separation of concerns. This principle guides us to keep our HTML structure distinct from its presentation.

As layout is presentational, we will generally want to use CSS to position our elements.


FAQ: Learn HTML Elements - Intro to HTML - Line Breaks
#5

Line brake elements are unique in the fact that you have to use only an opening tag. Why do you have to insert a double opening tag in the exercise?


#6

this statement is not true for html5, see this post

which exercise? Please link to exercise

inserting two break elements will create two breaks, thus more space between elements. Although the proper way would be to use <p> or <div> and use margins


#7

to make it a paragrapgh


#8

A paragraph has it’s own leading line-break and margin so a <br> is not essential to paragraph composition.

Line breaks need only be employed in rare instances, for convenience no less. CSS does provide for those instances as well but what’s to stop us from being stubborn or singleminded?

I use them any time text needs to appear on the next line, but then decisively so, by design. How it might be used or misused is par for the course in a declarative language environment

The point is we are the publishers and all the tools are right there. Yes, linebreaks are necessary to get us out of tight situations. but they should not be considered a part of normal page markup. The section and paragraph elements cover that.