We all know that the content you see in your browser is made from HTML and can be viewed by just right clicking on a web page and choose “View page source”. If you understand what you are seeing, then good for you but if it is gobbledygook, then you might need to go to w3schools.com to know what HML is.
HTML has progressed and the current official version is HTML 4. Some of these tags have been deprecated while some are still very much in use. So let us discuss 25 of the most useful HTML tags and tag attributes.
<title> – Since all web pages must have a title, so this self-explanatory tag will put the title of the web page in the title bar of your browser. The closing pair of this tag is </title>.
Note: In the next 24 tags, I will not provide the closing pair, it is understood that one is required (or none for tags that are called empty tags).
<a> – Since the web is hypertext, the <a> tag makes all those links possible.
href – this tag is used inside the <a> tag and represents the url where the link will jump into.
<img> – Web pages are supposed to show images together with text. The <img> tag indicates that an image will be shown on the page
src – The src attribute is the file name of the image to be displayed
alt – The alt attribute is used to provide a short description to the image. This is useful for sight impaired users who use text to speech synthesizers. The alt text will tell these users what the image is all about.
<p> – Indicates that text enclosed by the <p> tag is paragraph text
<h1> … <h6> – Provides structure to your text. <h1> is the most important heading while <h6> is not.
<ol> – Another tag that provides structure and stands for ordered list.
<ul> – A tag that says that what follows is an unordered list, much like bullet points
<li> – an item that belongs to a list
<html> – serves as the container for the document and it marks the beginning and the end of markup
<head> – a section of html where header information such as title and links to stylesheets are found
<body> a section of html that contains content
<link rel> indicates that an external file is linked to the current html document and is commonly used to link an external stylesheet to format the contents of the document
<div>– A division or a section of a page. Used as an additional means to provide structure to HTML.
class – an attribute used in <div> used for formatting HTML when stylesheets are used. When class is used, it means that this type of styling can occur many times in the document
id – another attribute found in <div> and is for formatting HTML when stylesheets are used. A particular id tag can only be used once
<script> denotes that text inside this tag is script that will add dynamic and interactive capabilities to the page
<form> – denotes that the area enclosed by this tag is an HTML form that can accept user input
<input> used inside an HTML form and is used to accept user input or submit the input
type – used inside input and may either accept entry of data through text boxes, radio buttons or select boxes. Is also used to show a submit button if type is equal to “submit”
label – used in forms and will label HTML input elements
<!–>– comment tag. Used to add text to your document that will not be displayed in the browser and is useful to document the design of the page.
What are listed above are 25 of the most useful tags and attributes used in most modern HTML pages today. Most of the deprecated tags are those that used to provide formatting to HTML. Formatting has been moved to stylesheets so that HTML will just consist of content and the structure that describes the content.