To declare a title in an HTML document, we use the title elements:
The highest level title is
<h1>, the one with the larger font size.
The browser is responsible for defining the font size, later in this lesson you will see how to modify the font, size, color etc. using the CSS language.
Depending on the importance of the title, we will use one of these HTML elements. It requires the closing mark of the title with the backslash, as we have seen.
The search engines like Google, Bing, Yahoo etc. uses this titles elements to identify the topic of a webpage.
Do not confuse the title of the page that goes in the <
head> section with the
h3 etc. tags.
We will make a page that contains a first level heading <
h1> and then two level headings <
h2>. We will define a paragraph for each second level heading.
<!DOCTYPEhtml> <html> <head> <title>Page title</title> <meta charset="UTF-8"> </head> <body> <h1>Data types in MySQL</h1> <h2>varchar</h2> <p> is used to store character strings. A string is a sequence of characters. It is placed between (single) quotation marks: 'Hello'.<br> The "varchar" type defines a variable-length string on which we determine the maximum of characters. You can save up to 255 characters. To store strings of up to 30 characters, we define a field of type varchar(30). </p> <h2>int</h2> <p> It is used to store integer numeric values, from -2000000000 to approximately 2000000000.<br> We define fields of this type when we want to represent, for example, quantities. </p> </body> </html>
Each title always appears on a different line, it does not matter if we type it in a row in the file, that is, the result will be the same if we do:
<h1>Data types in MySQL</h1> <h2>varchar</h2>
<h1>Data types in MySQL</h1><h2>varchar</h2>
The browser prints each title on a new line.
Note: HTML is not responsible for indicating the size of fonts. The browser will define the font size according to the title level that we specified. The largest size is level 1 <
<h1> comes from the word heading
Tips to remember this tag:
h means heading