HTML Flashcards
Where do you put non-visible content about the HTML document?
Where do you put visible content about the HTML document?
Inside the body
Where do the head and body and tags go in a valid HTML document?
The head is above the body and contains information about the page, instead of info within the main part of browser window
the body is the visible part under the head, and will show in browser window
What is the purpose of a DOCTYPE declaration?
DOCTYPE declaration to tell a browser which version of HTML the page is using (although browsers usually display the page even if it is not included).
Give five examples of HTML element types.
p, h1, h2, footer, header
What is the purpose of HTML attributes?
name and value
attribute signifies extra info
value is in double quotes
Give an example of an HTML entity (escape character).
Ampersand
How do block-level elements affect the document flow?
Always start on a new line, impact document flow
Eg:
h1 p ul li
div is block level
<address>
Contact information.
Article content.
</address>
A 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”.
How do inline elements affect the document flow?
Always appear to continue on same line
a b em img
span Inline
elements are those which only occupy the space bounded by the tags defining the element, instead of breaking the flow of the content.
s tag means strike through - represents something that is no longer relevant
del is better for delete or insert here tag, semantic meaning behind the tag
there is also <cite>
constinue on same line as nearby elements</cite>
What are the default width and height of a block-level element?
A 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”.
DEFAULT: HEIGHT OF CONTENT
WIDTH: changes how it will actually look on the page
What are the default width and height of an inline element?
Inline elements are those which only occupy the space bounded by the tags defining the element, instead of breaking the flow of the content.
Note: An inline element does not start on a new line and only takes up as much width as necessary.
pseudo display: inline-block -> the only way you can change the height and width of an inline element
What is the difference between an ordered list and an unordered list in HTML?
Ordered list - numbered
Unordered list - bullet point
list style type: none - to get rid of the bullets or numbers
there are also nested lists
always nest new UL’s within the Li, not as a direct child. Ul / Ol should only have direct li children
Is an HTML list a block element or an inline element?
Block element, they are also by default indented - you can change that with list style property
What HTML tag is used to link to another website?
An anchor tag
href attribute gives you the referance
What is an absolute URL?
Value of href attribute will be full web address when linking to other website
Absolute URL is a direct path to a website, starts with HTTPs
Domain and root are direct
What is a relative URL?
When linking to other pages in same in the same site, you don’t need to specify the domain
How do you indicate the relative link to a parent directory?
../filename
How do you indicate the relative link to a child directory?
example/index.html
How do you indicate the relative link to a grand parent directory?
../../
How do you indicate the relative link to the same directory?
“index.html”
How do you indicate the relative link to the same directory?
index.html
What is the purpose of an HTML form element?
send user data to a server and keep info then send something back
to collect info from visitors
info is sent in name value pairs
Give five examples of form control elements.
checkbox, radio, text area, password input, drop-down menu, label, button
buttons default inside a form is “submit” if you don’t want it to be submit, you can change it to button
type=text
name value pairs
type submit
type=password
type=email
value=save
action
Give three examples of type attribute values for HTML elements.
type=text
name value pairs
type submit
type=password
type=email