HTML Flashcards
How do you link a file in the same folder as the current HTML document?
Use an href attribute that refers to the html document.
Element tag
href attribute
./file (the ./ represents its in the same directory)
How do you link to a file in a folder one level up from the folder containing the current HTML document?
Use an attribute tag and use the href attribute that refers to ../ and your file name.
(<a>Your Text Here</a>)
What is an absolute file path?
The full URL name
Ex. “http://www.google.com
What is a relative file path?
A derivative of the absolute file path’s URL
Example: google.com/search?q=relative+links&rlz=1C5CHFA_enUS977US977&oq=relative+links&aqs=chrome..69i57j69i60.1831j0j15&sourceid=chrome&ie=UTF-8
What is a hyperlink?
An interactive text on the web that navigates the user from one link to another.
Do all HTML elements require a closing tag?
Most but not all. However it is in good practice to have or check for closing tags.
What are attributes for in HTML?
Attributes provide additional information about HTML elements.
- All HTML elements can have attributes.
- Attributes are always stated in the start of the tag.
- Attributes usually come in the name/value pair. (Ex. name=”value”)
What is the purpose of the alt attribute on the <img></img> element?
Alt attribute provides additional information for the <img></img> element in the case the image did not display.
How many heading elements are available for HTML?
6
What tags are necessary to complete an HTML skeleton?
- doctype declaration of html = this declares the document as html
- html tag = this is always at the beginning and end of the document
- head tag = provides info about the html
- title tag = gives a name for the html document that can be seen on the browser tab
- body tag = this provides visible and tangible information for the user
What type of content belongs within the head tag of an HTML document?
- Information about the HTML document
- Title tag that is used describe the document and for the user to see on the browser title or page tab
What type of information belongs within the body tag of the HTML document?
Visible and tangible content for the user. This includes: links, images, and text.
Where must the DOCTYPE declaration appear in a valid HTML document?
In the beginning of the document.
What is the difference between the href and src attribute?
href establishes a relationship between current application and external source
(relies on external resource)
src adds the resource to the page
(acquired internally)
Where do you put non-visible content about the HTML document?
Inside the head element
Info is called meta-data
Where do you put visible content about the HTML document?
Inside the body element
Where do the head and body tags go in a valid HTML document?
Head and body tags are children to the html element.
These two elements are siblings
What is the purpose of a !DOCTYPE declaration?
Declares that the document is HTML
Give five examples of HTML element types
Head, body, title, h1, p
What is the purpose of HTML attributes?
To describe/add/customize to a specific html element
Give an example of an HTML entity (escape character).
ambersan(&)word(xyz)semicolon(;)
- Do it to save time
- Isn’t mistaken for code
How do block-level elements affect the document flow?
These start a new line.
Only appear within the body element.
Take respective space of their parent element’s container.
How do inline elements affect the document flow?
These do not start on a new line.
Contain only data and other inline elements.
Cannot have block elements inside them.
What are the default width and height of a block-level element?
Takes the full width that is available (100%)
Takes as much height as content requires (auto)
What are the default width and height of an inline element?
Takes only as much width and height that has been stated. (auto)
Difference between b tag versus strong tag, i tag versus emphasis tag, or del and s tag versus strike tag.
Strong, emphasis, and del/s tag are used for screen readers and to explain specific data on the html
b and i tag are used for styling and should be changed via CSS instead
Strike tag is a deprecated tag and should no longer be used
What is the difference between an ordered list and an unordered list in HTML?
Ordered lists (ol) are ordered (default is numbered)
Unordered lists (ul) are unorganized (default is bulleted)
Is an HTML list a block element or an inline element?
An HTML list is a block element because it starts on a new line and the list takes the whole width of its parent’s container
How do you indicate the relative link to a parent directory?
(a href=”../fileName.html”)File Name(/a>)
How do you indicate the relative link to a child directory?
(a href=”childName/fileName.html”)Child Name(/a)
How do you indicate the relative link to a grand parent directory?
(a href=”../../grandParentFileName.html)Grand Parent File Name(/a)
How do you indicate the relative link to the same directory?
(a href=”fileName.html”)File Name(/a)
What is the purpose of an HTML form element?
Allows for the collection of data/information from the user
Give five examples of form control elements.
Adding Text
<ul><li>Text Input</li><li>Password Input</li><li>Text Area</li></ul>
Making Choices
<ul><li>Radio Buttons</li><li>Checkboxes</li><li>Drop-down boxes (select)</li></ul>
Submitting Forms
<ul><li>Submit Buttons</li><li>Image Buttons</li></ul>
Uploading Files
<ul><li>File Upload</li></ul>
Buttons
Give three examples of type attribute values for HTML < input > elements.
type="text" type="password" type="radio" type="checkbox" type="select" type="file" type="submit" type="image"
Is an HTML < input > element a block element or an inline element?
It is an inline element
What are the six primary HTML elements for creating tables?
Table, thead, tbody, th, tr, td
What purpose do the thead and tbody serve?
Thead - Contains the headings of the table
Tbody - Contains the body of the table
Give two examples of data that would lend itself well to being displayed in a table.
Tabular Data
- Stock tickers
- Sports results
- etc.