In this article, we will go through the HTML basics. In HTML basics we will learn different tags that we must consider and include while starting to code in HTML.
HTML documents always start with document type declaration:- <!DOCTYPE html>
HTML document starts with <html> and ends with </html>
The code which is visible on website is written inside <body> and </body>
HTML has six different headings which are defined with the <h1> to <h6> tags, from level h1(main heading) to the least level h6(least important heading).
h1 is the largest heading and h6 is the smallest one that’s why h1 is used for most important heading and h6 is used for least important.
<p> tag in HTML defines paragraph.
An HTML <p> tag indicates starting of new paragraph.
Note: If you add a lot of spaces inside the HTML <p> tag, browser removes extra spaces and extra lines while displaying the page. The browser always counts the number of spaces and lines as a single one.
Links in HTML are defined with <a> tag.
The anchor tag defines a hyperlink that links one page to another page. It can create a hyperlink to other web pages as well as files, locations, or any URL.
The “href” attribute is the most important attribute of the “a”tag, which links to the destination page or URL.
In HTML “img” tag is used to display image on the web page. The HTML tag is an empty tag that contains attributes only, closing tags are not used in the HTML image element. HTML img tag has src, alt, width, height attributes.
In HTML the <button> tag defines the button.
The <button> tag is used to create a clickable button.
HTML lists are used to present a list of information in a well-formed and systematic way.
The list is nothing but a record of information.
HTML list has 3 different types: