Semantics of html
Coding (Html5)Jan 10, 2017
How to use paragraphs and headings, the correct use of tags to code an accessible semantic
HTML is born for the creation of hypertext content and it is natural that most of the tags has been created for the organization of the texts, and for the translation of titles, sections, paragraphs, articles, spacing etc.
This organization has little to do with the graphical representation of the page, the theme today is semantics. Over time the HTML Tag that defined graphic aspects were gradually deprecated and they were the ones That help you identify sections and significant portions of the text.
Also it is true that the browser uses these tags to give greater clarity to the text assigning them prepackaged styles.
Paragraph p is a container element Within it Involves the insertion of text and other tags. Here's an example:
<P> Thanks to a simple example we can experience many things. </ P>
<P> By default, the browser will send the head to the contents of this second paragraph. </ P>
Also the tag p is an Block type element, this means for example That the basic behavior of the browser will be to start a new line at the end of the paragraph.
Headings, (titles h1, h2, h3, h4, h5, h6)
The titles (headings) are tags that help us define the theme of the page. Typically they are represented in bold and with a larger text size. Even these are elements of block type and both the size and the margin applied by default by the browser are proportional to the Importance of the title.
Hierarchy of headings
As you might guess from the numbers titles are hierarchical. This means that h1 will be the main title of the page. If we need other securities to specialize some important sections of the text (the "main sections") is recommended to choose first h2, h3 for subsections will use and so on with an increasingly granular breakdown up to use the h6.
The hierarchy also impacts on the weight that the headings have the page in terms of theming. The SEO tend to recommend to include your main keywords in H1 to define the content and the keywords that are ancillary h2.
Start a new paragraph
The br tag going to break line and is used to start a new line in the middle of a text.
If we want to leave a space between a portion of text and oneother we would use two paragraphs, but it can happen to use a double br.