Chapter 1 - Creating our First Website
We start building a website by creating a file named index.html, index.html is a special filename which is presented when the website root address is typed.
A Basic HTML Page
HTML | Description |
---|---|
<!Doctype html> → | Specifies this is an html 5 doc |
<html> | root of an HTML page |
<head> | Contains page metadata |
<title>FlowInCode</title> | Contains Title |
</head> | Closing Head |
<body> | The main body of the page (rendered by the browser)) |
<h1>This is a heading </h1> | Heading tag |
<p> My paragraph </p> → | Paragraph tag |
</body> | Closing body tag |
</html> | → |
A tag is like a container for either content or other HTML tags.
HTML Document → Browser → Rendered PageImportant Notes
- Head & Body tags are children of HTML tags.
- HTML is the parent of Head & Body tags.
- Most of the HTML element's have opening & closing tag with content in between opening & closing tags.
- Some HTML tags have no Content. These are called Empty elements eg:- <br>
- We can either use .htm or .html extension
- You can use "Inspect Element" or "View Page Source" option from chrome to look into a website's HTML Code.
HTML element = Start tag + Content + End Tag
Comments in HTML
Comments is HTML are used to mark text which should not be passed. They can help document the source code.
< ! ---HTML Comment -->Case Sensitivity
HTML is a case insensitive language <H1> & <h1> tags are the same.
Chapter 1 - Practice Set
- Inspect your favorite website and change somethings on the page which is displayed.
- Go to your favorite website and try to view the page source and write the exact lines of the code. Dose it clone the website? Why?
- Write any HTML code inside a text file. Does it work if your write it using notepad?
Please do not enter any spam link in the comment box.