All Cards Flashcards
Where do you put non-visible content about the HTML document?
In the head element
(Meta data e.g. Title are in the head element)
Where do you put visible content about the HTML document?
In the body element
E.g. h1-h6, p, ul, ol, li elements
Where do the head and body tags go in a valid HTML document?
In the html element (head element is above the body element)
What is the purpose of a DOCTYPE declaration?
To tell the browser what type of document is being used
(specifically with HTML it was used for which version of HTML was being used)
Give five examples of HTML element types.
head
body
h1 - h6
p
ul
ol
li
div
What is the purpose of HTML attributes?
To provide additional information on the content of an element
E.g. Class, ID, src…
Give an example of an HTML entity (escape character).
Less Than <
Greater Than >
Ampersand &
Cent ¢
Pound £
Yen ¥
Euro €
Copyright ©
Registered trademark ®
Trademark ™
Multiplication ×
Division ÷
How do block-level elements affect the document flow?
Block level elements always start on a new line. They do not allow any other elements on the same line as them.
Example Block Elements:
ul
ol
li
h1-h6
p
div
How do inline elements affect the document flow?
Inline elements will continue on the same line. They allow other elements to be on the same horizontal line.
Example Inline Elements:
button
span
strong
em
What are the default width and height of a block-level element?
Width: width of its containing block
Height: height of content
What are the default width and height of an inline element?
Width: width of content
Height: height of content
What is the difference between an ordered list and an unordered list in HTML?
An ordered list numbers each line in ascending order and an unordered list shows each item next to a bullet point.
OL:
1.
2.
3.
-
-
Is an HTML list a block element or an inline element?
Block element because it lists each item on its own line.
What HTML tag is used to link to another website?
Anchor Tag (the a element)
a href=”link”
What is an absolute URL?
An absolute URL is a link to a specific URL on the web (can be a completed different website [href is the full web address] )
E.g.
a href=”https://www.google.com”
What is a relative URL?
A relative URL is a link to other pages within the same site (href does not need the domain name)
E.g.
a href=”index.html”
“What is the internet?”
The internet is a global network of computers that are connected to each other. Every computer on the public Internet has an IP address
“How does the web work?”
- Your browser needs to know what a domain name means. A DNS (domain name system) lookup is performed to translate the domain name into an IP address.
- The browser then opens a TCP connection to the computer at the IP address.
- The browser then sends an HTTP request to the computer at the IP address.
- The browser receives a response from the computer at that IP address (originally this was an HTML document).
How do you indicate the relative link to a parent directory?
WIth ../
Example:
href=”../filename”
How do you indicate the relative link to a child directory?
With the folder name / file name
Example:
href=”foldername/filename”
How do you indicate the relative link to a grand parent directory?
You use a ,,/ for each directory you want to move up (grandparent is 2 directories above so 2 ../)
Example:
href=”../../filename”
How do you indicate the relative link to the same directory?
You can just link the file name.
Example:
href=”filename”
What is the purpose of an HTML form element?
The HTML form element houses the section of the HTML document that contains interactive controls for submitting information
Give five examples of form control elements.
Button
Input - the input type is noted in the type attribute
Select - used to create a dropdown selection element
option - used to provide options for the dropdown selection element
textarea - used to provide a block to input larger amounts of text in