Introduction to HTML
HTML is a Markup language
HTML was created to help describe the structure of the acedemic research papars and share they across the very early internet.
The goal of HTML is to take the text content and somehow mark it up with some structures.
HTML Elements
To write HTML, we pick from a set of standard Elements that all browsers recognize
Common Elmements includes:
1 | - <p> element: represent a paragraph of text |
Our Very First HTML Page
- Save your HTML file with the file extension [.html]
- After that you should be able view your web in local browser
1 | DEVELOPING ON OMNIVERSE |
1 | DEVELOPING ON OMNIVERSE |
Developer Resources
https://developer.mozilla.org/en-US/
HTML Tags
Fast Way to Type HTML Tags
For example:
1 | <b></b> |
Press ‘b’ then ‘Tab’ to autocomplete
Paragraph Tag
1 | <p>Something in between</p> |
- Take a block of space
Heading Elements
1 | - <h1></h1> |
Chrome Inspector
Right click on the webpage select “Chrome Inspector” and then we can see the html instruction of the current showing web.
HTML Boilerplate
HTML SKELETON
We write our HTML in a standard “skeleton”
1 |
|
- !DOCTYPE html is weird by not having the closing tab
- Html element should have inside
- head tag
- body tag
- Title is for the webpage name/ tab-name(Google use this tag element in the head to create the link in the search result)
Short cut for generate this skeleton
! + “Tab”
1 |
|
Reference Resources
- https://developer.mozilla.org/en-US/docs/Web/HTML/Element
- https://developer.mozilla.org/en-US/docs/Web/HTML/Element/head
- https://developer.mozilla.org/en-US/docs/Web/HTML/Element/title
VSCode Tip: Auto-format
Ctrl + Shift + P + (searching “format”)
List Element
1 | - unordered list <ul></ul> |
The Anchor Element
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a
1 | <p>You can reach Michael at:</p> |
Image
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img
1 | <img src="picture_location" alt="Some description about the pictue"> |
- note that image tag don’t have closing tag
The alt attribute holds a text description of the image, which isn’t mandatory but is incredibly useful for accessibility.
Comment
1 | <!-- comment --> |
The Shortcut In VScode
Toggle line comment