Table of Contents
ToggleWhat is HTML?
- HTML stands for HYPER TEXT MARKUP LANGUAGE
- It is not a programming language but a markup language
- It is used by web browsers to compose text, images, audio, videos and other material.
Starting HTML
- You can write html code in simple notepad and then save it with .html or .htm extension. It will then open in browser
- There are many editors available and you can choose which you are comfortable with.
Available Editors
- Visual Studio Code
- Notepad++
- Sublime Text
- Atom. you can download any editor of your choice.
HTML Elements
- HTML element is every content that come in pair of starting and closing tag. e.g. <starting tag> content goes here </closing tag>.
- Nested elements – one Html element can contains other element .e.g. <starting tag1> <starting tag 2> content here</closing tag 2></closing tag1>.
- Tags must be close in the order in which they are opened.
- Empty elements – some Html elements have no content e.g. <br> ,<hr> ,<img> are empty elements.
HTML Attributes
- Html Attribute provide addition information about elements.
- Html attribute always come in Name=”value” pair.
- Attribute always defined in starting Tag e.g. <p style=”color:red;”>your paragraph here </p>. Here style is attribute of <p> tag that will give red colour to content.
- Html is not case Sensitive.
Document structure
- Html document Comprises a tree -like Structure.
- First level is HTML tag , Which is root element and contains two main tag i.e. Head and Body.
- Head tag defines Details about the page like title, Link , Style, Script etc. and body tag contains actual content which get rendered on the page.
Block Level Elements
- Block level Html Elements always starts with new line.
- They take up complete width available.
- Browser automatically add space before and after the elements.
- e.g. <p>, <h1>, <h2> ,<div> etc.
Inline Elements
- Inline Html Elements do not start with new line of their own.
- They take up as much width as needed .
- e.g. <span>
- Inline element cannot contain block level elements.
HTML Tags
- Html tags define how browser will display and format the content
- HTML tag always enclosed in angle brackets <>.
- If tag is opened then it must be closed .