HTML Flashcards
Where do you put non-visible content about the HTML document?
You would put inside the head tag element at the beginning, after the html doc type element.
Where do you put visible content about the HTML document?
In between element
Where do the and tags go in a valid HTML document?
Both child elements of HTML
Head - contains info about the page. Rather than info that is shown the main part of the browser window,
Body - everything inside this element is shown within the main browser window.
Head and Body are siblings
What is the purpose of a declaration?
To tell a browser which version of html this page is using
Can also help in rendering a page correctly
Give five examples of HTML element types.
<img></img>
What is the purpose of HTML attributes?
Attributes provide additional information about the contents of an element
Made up of two parts, a name and a value. Separated by an equal sign
Every HTML element has its own behavior
Give an example of an HTML entity (escape character).
< < > > & & “ &
How do block-level elements affect the document flow?
They stare a new line in the browser window
Examples of block elements are h1, p, ul, li
How do inline elements affect the document flow?
Elements that will always appear to continue on the same line as their neighboring elements
a , b, em, img
What are the default width and height of a block-level element?
Block-level element occupies the entire horizontal space of its parent element (container), and vertical space equal to the height of its contents, thereby creating a “block”.
100% - width
Auto - height
What are the default width and height of an inline element?
Width - auto
Height - auto (equal to the contents)
Take exactly as much space as is required/needed
What is the difference between an ordered list and an unordered list in HTML?
Ordered list Where each item in the list is numbered Unordered list Lists that begin with a bullet point Rather than characters that dictate orders
Is an HTML list a block element or an inline element?
Block element
What HTML tag is used to link to another website?
<a> tag element, however, you should use absolute URL when linking to another website
Anchor element
Called anchor element because it is ‘dropping anchor in a certain spot’</a>
What is an absolute URL?
Full web address
An absolute URL starts with the protocol and domain name for that site, and can be followed by the path to a specific page.
What is a relative URL?
These are like a shorthand version of absolute URLs because you do not need to specify domain name
Used to take to to pages within the same site
How do you indicate the relative link to a parent directory?
Use ../ to indicate the folder above the current one, then follow it with the file name
How do you indicate the relative link to a child directory?
For a child folder, use the name of the child folder, followed by a forward slash, then the file name.
music/listing.html
How do you indicate the relative link to a grand parent directory?
Repeat the ../ to indicate that you want to go up two folders (rather than one). Then follow it with the file name
../../index.html
How do you indicate the relative link to the same directory?
To link to a file in the same folder, just use the file name. Nothing else is needed
What is the purpose of an HTML form element?
Used to collect information from visitors to your site
Boundary that the form control elements are meant to be within
Give five examples of form control elements.
Text input Password input text area Radio buttons Check boxes - Drop down boxes -
Give three examples of type attribute values for HTML elements.
Type = “text” or type = “password” or type = “radio”
Name
size
Is an HTML element a block element or an inline element?
Inline