Basic HTML Flashcards
Try to write out the structure of an HTML5 boilerplate.
What does β< !DOCTYPE html >β do?
Declaration is an instruction to the web browser to parse the page as HTML5.
What is the root element of which all other elements are children of?
The HTML element
What does the head element do?
< head >< /head >
The head element contains metadata about the HTML document.
This is where we bundle together the various elements that tell the browser about our document.
What does the meta element do?
< meta >
Metadata. The meta element is versatile. Each instance contains different information about the document
What does the title element do?
< title >< / title >
Web browsers display the text in the title element in the browser tab.
Web crawlers also look to this element to help classify web pages, so it plays an important part in SEO.
The title element is required for all HTML documents.
What does the link element do?
< link >
The link element creates a link between the HTML document and other resources, such as stylesheets.
What does the body element do?
< body >< /body>
Delineates the main displayable elements of a web page.
What does the script element do?
< script >< /script >
The script element is used to define the frontend JavaScript for a web page.
It can either link to an external JS file (which is how weβll use it in this course) or contain scripts directly in the HTML file.
The script element can live in the
or the depending on which features you want to load first.
What does this line do:
< html lang=βenβ >
lang attribute identifies the language of text content.
What does this line do?
< meta charset=βUTF-8β >
charset defines the character encoding for the doc.
What does this line do:
<meta name=βviewportβ content=βwidth=device-width, initial-scale=1β>
width=device-width sets the width of the page to follow the screen-width of the device.
initial-scale=1 sets the zoom level when the page is loaded for the first time.
What does βname=βviewportββ do?
viewport gives the browser instructions on how to control the pageβs dimensions and scaling.
What does this line do:
<meta http-equiv=βX-UA-Compatibleβ content=βie=edgeβ>
Used to solve compatibility issues.
Chooses what version of IE the page should be rendered as.
What does this line do:
<meta name=βdescriptionβ content=ββ>
Provides brief summary of a web page.
Search engines often display the meta description (typically up to 160 char long).