HTML Flashcards

1
Q

Where do you put non-visible content about the HTML document?

A

In the head element (title of the tab) Before the element you will often see a element. This contains information about the page (rather than
information that is shown within the main part of the browser window that is highlighted in blue on the opposite page). You will usually find a element inside the element.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Where do you put visible content about the HTML document?

A

Everything inside the element is shown inside the main browser window.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Where do the and tags go in a valid HTML document?

A

They go within the HTML element and are sibling elements to the head element as well as to each other. (Head element goes first and then body follows after)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the purpose of a declaration?

A

To tell a browser which version of HTML the page is using.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What tags are necessary for a complete HTML Skeleton?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What type of content belongs within the of an HTML document?

A

The element contains meta information about the HTML page.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What type of content belongs within the of an HTML document?

A

The element defines the document’s body and is a container for all the visible contents, such as headings, paragraphs, images, hyperlinks, tables, lists, etc.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Where must the DOCTYPE declaration appear in a valid HTML document?

A

The declaration defines that the document is an HTML5 document and appears at the very top of the document.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Give five examples of HTML element types.

A

<p> </p>

<div></div>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the purpose of HTML attributes?

A

Attributes tells us more about elements. Attributes provide additional information
about the contents of an element. They appear on the opening tag of the element and are
made up of two parts: a name and a value, separated by an equals sign.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Give an example of an HTML entity (escape character).

A

There are some characters that are used in and reserved by HTML code. (For example, the
left and right angled brackets.) Therefore, if you want these characters to appear on your page you need to use what are termed “escape” characters (also known as escape codes or entity references). For example, to write a left angled bracket, you can use either < or <. For an ampersand, you can use either & or &.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How do block-level elements affect the document flow?

A

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”. Browsers typically display the block-level element with a newline both before and after the element. You can visualize them as a stack of boxes. A block-level element always starts on a new line and takes up the full width available (stretches out to the left and right as far as it can). Block-level elements may appear only within a element.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How do inline elements affect the document flow?

A

Inline elements are those which only occupy the space bounded by the tags defining the element, instead of breaking the flow of the content. Appears on the same line as the element it is occupying.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are the default width and height of a block-level element?

A

A block-level element always starts on a new line and takes up the full width available (stretches out to the left and right as far as it can).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are the default width and height of an inline element?

A

An inline element does not start on a new line and only takes up as much width as necessary. Based on the content that surrounds the element. They will never be bigger than their content.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Do all HTML elements require a closing tag?

A

Some HTML elements have no content (like the <br></br> element). These elements are empty elements. Empty elements do not have an end tag.

17
Q

What are attributes for in HTML?

A

All HTML elements can have attributes. Attributes provide additional information about elements and are always specified in the start tag. Attributes usually come in name/value pairs like: name=”value”

18
Q

What is the purpose of the alt attribute used on <img></img> elements?

A

The required alt attribute for the <img></img> tag specifies an alternate text for an image, if the image for some reason cannot be displayed. This can be due to slow connection, or an error in the src attribute, or if the user uses a screen reader.

19
Q

How many heading elements are available in HTML?

A

HTML headings are defined with the <h1> to </h1><h6> tags.

</h6><h1> defines the most important heading. </h1><h6> defines the least important heading.</h6>

20
Q

What is the difference between an ordered list and an unordered list in HTML?

A

An ordered list uses numbering (numbers, letters, roman numerals, etc.) whereas an unordered list uses bullet points (circles, squares, diamonds, etc.)

21
Q

Is an HTML list a block element or an inline element?

A

Block element

22
Q

Nesting lists, can <ul> and </ul><ol> have </ol><ul> and </ul><ol> as children?</ol>

A

No, it can only have <li> as the direct child. However, <ul> and </ul><ol> can be nested within the <li> element.</li></ol></li>

23
Q

What HTML tag is used to link to another website?

A

<a>Text content here</a>

Use target=”_blank” to open up external links in a new tab so we don’t redirect users away from our website.

24
Q

What is an absolute URL?

A

When you link to a different website, the value of the href attribute will be the full web address for the site, which is known as 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. If no page is specified, the site will display the homepage.

25
Q

What is a relative URL?

A

When you are linking to other pages within the same site, you do not need to specify the domain name in the URL. You can use a shorthand known as a relative URL. If all the pages of the site are in the same folder, then the value of the href attribute is just the name of the file.

26
Q

When is it appropriate to use <em> and <strong> over <b> and <i>?</i></b></strong></em>

A

Always. The reason for this is because <em> and <strong> elements are more accessible to screen readers for those that are visually impaired. Semantics!</strong></em>

27
Q

How do you indicate the relative link to a parent directory?

A

Use ../ to indicate the folder above the current one, then follow it with the file name. To link to the homepage from the music reviews: <a>Home</a>

28
Q

How do you indicate the relative link to a child directory?

A

For a child folder, use the name of the child folder, followed by a forward slash, then the file name. To link to music listings from the homepage: <a>Listings</a>

29
Q

How do you indicate the relative link to a grand parent directory?

A

Repeat the ../ to indicate that you want to go up two folders (rather than one), then follow it with the file name. To link to the homepage from the DVD reviews: <a>Home</a>

30
Q

How do you indicate the relative link to the same directory?

A

To link to a file in the same folder, just use the file name. (Nothing else is needed.) To link to music reviews from the music homepage: <a>Reviews</a>

31
Q

What is the purpose of an HTML form element?

A

Form controls live inside a form element. This element should always carry the action attribute and will usually have a method and id attribute too.

Allow the developer or website to collect information (user input). A way for user to submit data which can be used for whatever purpose.

action: Every element requires an action attribute. Its value is the URL for the page on the server that will receive the information in the form when it is submitted.

32
Q

Give five examples of form control elements.

A

Text input, password input, text area, radio buttons, checkboxes, drop-down boxes, submit buttons, image buttons, file upload

33
Q

Give three examples of type attribute values for HTML < input > elements.

A

type=”text”, name, maxlength, size, type=”password”

34
Q

Is an HTML input element a block element or an inline element?

A

Inline element

35
Q

What are the six primary HTML elements for creating tables?

A

table, tr, td, th, thead, tbody, tfoot

36
Q

What purpose do the < thead > and < tbody > elements serve?

A

< thead > The headings of the table should sit inside the < thead > element.
The < thead > HTML element defines a set of rows defining the head of the columns of the table.

< tbody > The body should sit inside the < tbody > element.
The < tbody > HTML element encapsulates a set of table rows
( < tr > elements), indicating that they comprise the body of the table (< table >).

37
Q

Give two examples of data that would lend itself well to being displayed in a table.

A

Financial reports, TV schedules, sports results, market, weekly weather reports, hospital data with patient information