Html Flashcards
What are HTML elements?
Pieces of contents wrapped in opening and closing tag. Ex. <p> </p>
What are opening tags? Purpose?
Comprise of a keyword enclosed in angle brackets <>. They tell the browser this is the start of an HTML element. Ex. <p>
What are closing tags? Purpose?
Almost the same as opening tags but they have a forward slash before the keyword. That tell the browser where and element ends. Ex. </p>
What is the purpose of elements?
Containers for contents.
The element tells the browser what the info is to determine how it should interpret and format the content.
Purpose of tags?
The tags tell the browser the content of the element.
Define self closing tags (empty elements)
They don’t wrap around any elements. Ex. <br></br> or <img></img>
What is the purpose of the (.html) extension?
To let the computer know we want to create an HTML file
Purpose of naming an html file (index)? (❗️)
The html file named index is where web server will look for by default as the homepage of the website
What is the Doctype declaration?
<!DOCTYPE html>
What is the purpose of Doctype?
It is to tell the browser what version of HTML it should use to render the page.
What is the <html> element? (❗️)
This is known as the root element of the page - this means every other element will be a descendant of it.
What is the function of the lang attribute? (❗️)
lang=en
Specifies the language of the text content in that element
Put inside the html element
What is the purpose of the lang attribute?
Primarily used for improving accessibility of the web page. For assistive tech like the screen reader to adapt according to the language.
What is the function of the head element? (❗️)
It’s where the important meta-info about the webpage, and stuff it requires to render properly are stored.
What to not use in the head element?
Any element that displays content on the webpage.
What is the charset encoding? (❗️)
<meta charset=“UTF-8”>
What is the function and purpose of the charset encoding?
It ensures that the webpage will display special symbols and characters from different languages correctly in the browser.
What is the function and purpose <title> element? (❗️)</title>
Used to give webpages a human-readable title which is displayed in our webpages browser.
What is the function and purpose of the <body> element?
This is where all the content that will be displayed to users will go. (The text, images, lists, links etc.)
How to view files in browser?
google-chrome file.extension
What is the boilerplate?
The backbone of ever html page.
<!DOCTYPE html>
<html lang=“en”>
<head>
<meta charset=“UTF-8”>
<title> </title>
</head>
<body>
<h1> </h1>
</body>
</html>
What’s the paragraph element?
<p> </p>
Function of the paragraph element?
Adds a newline after each of our paragraphs.
Explain the 6 different levels of headings.
From <h1> the biggest to <h6> the tiniest.
Purpose of <h1> element?
Use for the heading of the overall page.
What is the <strong> element function?</strong>
Makes the text bold. It also semantically marks text as important.
What is the <em> element function?</em>
Makes the text italic. Semantically places emphasis on the text.