HTML Flashcards
HTML flashcards
Where do you put non-visible content about the HTML document?
In the head element.
However - the title element within the head element will be visible at the top of the browser or in the browser tab.
Where do you put visible content about the HTML document?
In the body element.
Where do the head and body tags go in a valid HTML document?
In the html element located beneath the doctype declaration. The <html>
element is the root element.
What is the purpose of a <!DOCTYPE>
declaration, and where does it go?
Ensures that the browser renders the document as HTML and follows HTML specifications. <!DOCTYPE html>
specifically means that the document is an HTML5 document. The declaration goes at the very top of the document.
Give five examples of HTML element tags.
- body
- head
- title
- line break:
<br/>
(empty tag with no closing tag) - span
- extra- - horizontal rule: hr (empty tag with no closing tag)
- anchor: a (with href attribute and file path)
- p
- div
-
<img/>
(empty tag with no closing tag) - `<meta></meta> (empty tag with no closing tag)
What is the purpose of HTML attributes?
To provide more information about the contents of the associated element. It is comprised of an attribute name and a corresponding value. Attributes are always specified in the opening or start tag. Attributes usually come in name and value pairs, ex: name=”value”
Give an example of an HTML entity (escape character).
Ampersand: &
(ampersand symbol)amp;
-extra-
Trademark: ™
(ampersand symbol)trade;
All end with semicolon.
How do block-level elements affect the document flow?
Breaks the document flow and creates line breaks between neighboring elements, starts on a new line.
Block-level elements take up the entire horizontal space of its parent element by default, and the vertical space needed for its contents.
How do inline elements affect the document flow?
The elements will appear to continue on the same line as neighboring elements. Inline elements take up the least amount of space available bounded by the tags defining the element, instead of breaking the flow of the content. Any height and width properties will have no effect.
What are the default width and height of a block-level element?
All of the horizontal space available within its parent element (container), and the vertical space needed for the height of its contents.
What are the default width and height of an inline element?
An inline element does not start on a new line and only takes up as much width and height as necessary, bounded by the tags defining the element.
What is the difference between an ordered list and an unordered list in HTML?
Ordered lists are numbered or in sequence (A-Z) and unordered lists are not numbered and use bullet points
Is an HTML list a block element or an inline element?
The list and list items are both block-level elements.
What HTML tag is used to link to another website?
Anchor tag with an href attribute.
What is an absolute URL?
An absolute URL starts with the domain name for that site and can be followed by the path to a specific page. Used for external website links.
What is a relative URL?
A URL that links to other pages within the same site, you do not need to specify the domain name in the URL.
How do you indicate the relative link to a parent directory?
../file-name
How do you indicate the relative link to a child directory?
Href attribute should contain ../../ preceding the file name and type enclosed in double quotes. child-folder-name/file-name
How do you indicate the relative link to a grandparent directory?
Href attribute should contain ../../ preceding the file name and type enclosed in double quotes. <a href="../../file-name.type"
use
../` for each generation of directories.
How do you indicate the relative link to the same directory?
Href attribute should simply contain the file name and type enclosed in double quotes. <a href="file-name.type"></a>
What is the purpose of an HTML form element?
To obtain information and data from users via a structured set of elements.
Give five examples of form control elements.
form, fieldset, legend, textarea, label
-extra-
button, and input
Give three examples of type attributes for HTML input elements.
Radio, button, checkbox,
-extra-
image, submit, text
Is an HTML element a block element or an inline element?
Inline, and that is why we have to insert them into a div.