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:
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.
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.
HTML Links:
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.
Example:
<a href=”w3codingschools.com”> Click here to go on this link </a>
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.
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.Ok