Basics of HTML
The basics of HTML are points which a web designer needs to know. By this, you can work easily with HTML tags and implement them in any web page designing.
In this article, I am going to share with you, some basic information which you need to know while working with HTML. These are the basics of HTML which helps to understand the writing of HTML codes in making a webpage in a proper and systematic way.
What is HTML?
HTML Stands for HyperText Markup Language. HTML is coding which helps in making a web page or a website. HyperText means that text, which is connected to other links or files. Therefore, any language which creates such text which can be connected with other website or web page with a link is called HTML.
HTML has gone through many updated (many versions) since its existence. Namely, HTML 4.01 was the last stable version (means existed for a long period of time). Later it is upgraded to HTML5 (current version).
How to write HTML codes?
The Basics of HTML works in a very simple but effective manner (that is why, it is not a strictly typed language, like other languages). Although it can be applied without any rule, it is recommended to write HTML codes with certain rules.
To write HTML codes, we do not require any special tools or software for a start. You can simply type these codes in any text editor (which is already available in your operating system). You can even run those codes in any browser available in your operating system.
Therefore, we need only two software for practicing HTML:
- Editor: Editor can be anything. Notepad, Notepad++, Sublime Text, Atom, VSCode, etc
- Browser: Browser can be anything. Internet Explorer, Google Chrome, Apple Safari, Opera, Mozilla Firefox, etc
What is a Web page?
The web page is an output of codes written in HTML. Since HTML is not a strictly typed language, simple text written in any editor and saved with .htm or .html extension is considered as a web page. This web page can be viewed in any browser like a web page.
What are HTML codes?
HTML codes are predefined text for HTML covered inside < >. These code are called HTML elements or HTML tags. The tag names are pre-defined features that are used to apply certain effects on the web page. These HTML tags are divided into two types:
- Container tags: These tags when applied around any text or content, the effect of that tag is applied to it. They have two tags combination, i.e. starting tag <tagname> and closing tag with/at the beginning of it </tagname>
Example:
Here text surrounded by "b" tags is converted into bold and text surrounded by "i" tags are converted into italic. - Stand-alone tags: These tags are itself an effect, which, when typed are shown on the web page. They have only one tag, i.e. tag name itself with/at the end of it <tagname/>
Example:
Here "br" tag adds a break in the line(change the line) and the "hr" tag draws a horizontal line.
Semantics for Tags
Every HTML page has a writing codes format which need to be followed throughout the HTML coding. These codes starts with HTML tags. HTML contains two child tags, i.e. HEAD and BODY tags. HEAD tags contains all the tags which are used for webpage's identity and controls on the server. Like, TITLE tags, SCRIPT tags, STYLE tags, META tags, etc. Whereas, BODY tags contains all the tags which shows the contents of the webpage with formats and styles. Like, B tags, HR tag, IMG tag, UL tags, TABLE tags, etc. Therefore, we can divide tags in a relationship of parent, childs and siblings. Where main tags are considered as parents, their inner tags are considered as their childs, and if more than one tag comes under parent tags, then their child tags are siblings to each other. Basic symentics of tags for every webpage includes the following format:
Attributes of Tags
Attributes are the adjective of tags, which add some more meaning to the tag. Attributes contain properties that help tag to provide some more effects to the basic tags, especially formatting and controls. Attributes help a tag to become more powerful in representing text or any content within them.
Example:Here, width, size, color, align are attributes of HR tag, and value passed in inverted commas "" are properties of these attributes.
Rules for creating a Webpage / Website
- Every Web page must be saved with the extension ".htm" or ".html"
- For creating a website, there must be a dedicated folder for the site containing all the web pages save inside it.
- The first page of the website must have the name "index.html" or "default.html" or "home.html" as the server finds this page first out of your website folder.
- All images, stylesheets, and scripting must be saved in the sub-folder of the website.
- Web page names must be in lowercase, descriptive, and without space. You can use the hyphen "-" instead of spaces between words.
- Every attribute of the tag must have a property defined in double inverted commas " "
- All tags must follow the proper semantics, i.e. parent, child, and siblings relationship.
Conclusion
So, that was all which you need to know before starting code with HTML. I hope this will help you all to understand and apply HTML coding. This will definitely make your coding easy.
Do let me know if this was helpful to you, by commenting in the comment section. You can as queries which will help me to write more about the stuff.
Comments
Post a Comment
If you want to share your queries or suggestion, please let me know to help you better.
Please do not enter any spam link in the comment box.