HTML Notes
HTML Notes
Html introduction
• <!Doctype html> - Specifies this is an html5 document
• <html> - root of an HTML page
• <head> - Contains page metadata
• <title> Sajal website </title> - Contains title
• </head>
• <body> - Main body of the page (rendered by browser)
• <h1> This is a heading </h1> - heading tag
• >p> My paragraph </p> - paragraph tag
• </body> - closing body tag
• </html> - closing html tag
BODY
Empty elements
HTML Element
• Everything from starting to the ending tag
<body> - Opening tag
-Content-
</body> - Closing tag
HTML Attributes
Used to add more information corresponding to an HTML tag.
Example: <a href=”https://google.com”>google</a>
Note-
<a href="https://google.com" target="_blank">google</a>
target="_blank – refer to open the page in another window
Make different html files and line that file in body through
Suppose you make a file name tracking.html and want to open that side while
clicking track button
<a href="https://tracking.html">track</a>
Note-
<b> This is bold </b>
<i> This is italic </i>
<u> This is underline </u>
<hr> tag in HTML is used to create a horizontal ruler often used to separate the
content.
Lists
Unordered list: Used to list unordered items
<ul>
<li> Home </li>
<li> About </li>
.
.
</ul>
Like dot , circle , squar.
We use - <ul type= "circle">
Tables
The <table> tag is used to define tables in HTML.
tr tag: used to display table row
td tag: used to display table data
To add a caption to the table, we use <caption> tag inside the table.
thead tag: used to wrap table head (caption & tr with th)
tbody tag: used to wrap the table body
HTML Forms
An HTML form is used to collect input from the user.
form tag is used for the same
<form>
-Element of the form-
</form>
• input element: Can be of type text, checkbox, radio, button and submit. We
also have a ‘file’ type
• textarea element: Defines a multi-line text input. Cols and rows attributes
can be used to size the textarea.
• select element: Defines a drop down list
• Embedding Videos
Video tag is used to play videos in HTML
<video src=”harry.mp4”> Error </video>
<span> xyz</span>
Span attribute is use to merge different paragraph to one single paragraph
-------------------------------------------------------------------------------------------------------------