HTML

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/58

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

59 Terms

1
New cards

What is the difference between a <p> and a <span> tag? 

It’s best to use a <span> element when you want to target a specific piece of content that is inline, or on the same line as other text. If you want to divide your content into blocks, it’s better to use a <div>

2
New cards

What does the <em> tag do?

The <em> tag will generally render text with an italic emphasis

3
New cards

What does the <strong> tag do?

The <strong> tag will generally render text with a bold emphasis.

4
New cards

What does the <br> tag do?

The <br> tag creates a line break.

5
New cards

Does the <br> tag have a closing tag?

No, the <br> tag only has an opening tag.

6
New cards

What does the <ul> tag do?

In HTML, you can use an unordered list tag (<ul>) to create a list of items in no particular order. An unordered list outlines individual list items with a bullet point.

7
New cards

Generally, should the <ul> or <ol> tag hold raw text?

The <ul> and the <ol> element should not hold raw text and won’t automatically format raw text into an unordered/ordered list of items. Individual list items must be added to the unordered list using the <li> tag

8
New cards

What does the <ol> tag do?

Ordered lists (<ol>are like unordered lists, except that each list item is numbered

9
New cards

What does the <img> tag do”?

The <img> tag allows you to add an image to a web page.

10
New cards

Does the <img> tag have a closing tag?

Most elements require both opening and closing tags, but the <img> tag is a self-closing tag. Note that the end of the <img> tag has a forward slash /. Self-closing tags may include or omit the final slash — both will render properly

11
New cards

What is the required attribute for the <img> tag?

The <img> tag has a required attribute called src. The src attribute must be set to the image’s source, or the location of the image.

12
New cards

What does the alt attribute do?

The alt attribute, which means alternative text, brings meaning to the

images on our sites. The alt attribute can be added to the image tag just like the src attribute. The value of alt should be a description of the image.

13
New cards

What does the <video> tag do?

In HTML, the <video> tag supports displaying videos. Like the <img> element, the <video> element requires a src attribute with a link to the video source. 

14
New cards

Does the <video> tag have a closing tag? 

Yes, the <video> tag requires an opening and closing tag.  

15
New cards

If there is text inside of the <video> tag, what condition must be fulfilled for the text to show?

Text between the opening and closing <video> tags will only be displayed if the browser is unable to load the video.

16
New cards

How do we let web browsers know that we are using HTML?

By starting our document with a document type declaration. The declaration looks like : <!DOCTYPE html>. This tells the browser the type of document and the HTML version to expect.

17
New cards

What tag do we use to create HTML structure and content?

We use the <html> tag to create HTML structure and content. Anything between the opening <html> and closing </html> tags will be interpreted as HTML code. Without these tags, it’s possible that browsers could incorrectly interpret your HTML code.

18
New cards

What tag do we use to give the browser some information about the page itself? 

We can do this by adding a <head> element. The <head> element contains the metadata for a web page. Metadata is information about the page that isn’t displayed directly on the web page.

19
New cards

What tag allows us to change the title a tab displays?

A browser’s tab displays the title specified in the <title>. The <title> tag is always inside of the <head>

20
New cards

What does the <a> tag do?

You can add links to a web page by adding an anchor element

<a> and including the text of the link in between the opening and closing

tags. 

21
New cards

Which attribute specifies how a link should open?

The target attribute specifies how a link should open. For a link to open in a new window, the target attribute requires a value of _blank. The target attribute can be added directly to the opening tag of the anchor element, just like the href attribute

22
New cards

What is a relative path?

A relative path is a filename that shows the path to a local file (a file on the same website, such as ./index.html) versus an absolute path (a full URL, like https://www.codecademy.com/learn/learn-html which is stored in a different folder). The ./ in ./index.html tells the browser to look for the file in the current folder.

23
New cards

Is it possible to add a link to an image? If so, how can we do it?

Yes, you can add a link to an image by wrapping the <img> tag with an anchor tag ( <a> ).

24
New cards

Is it possible to link to a specific section of a page? If so, how can we do it?

In order to link to a target on the same page, we must give the target an id attribute and a unique value.

25
New cards

The W3C (World Wide Web Consortium) recommends how many spaces of indentation when writing HTML code?

2 spaces of indentation.

26
New cards

How can we write a comment?

Comments begin with <!-- and end with -->. Any characters in between will be ignored by your browser.

27
New cards

Why are comments useful?

  1. They help you (and others) understand your code if you decide to come back and review it at a much later date.

  2. They allow you to experiment with new code, without having to delete old code.

28
New cards

What is the current HTML standard?

HTML5 is the current HTML standard

29
New cards

Which tag creates a table?

The <table> tag creates a table.

30
New cards

How can we add titles to rows and columns?

Using the table heading tag <th>

31
New cards

What is the purpose of the scopes row and col?

row makes it clear that the table heading is for a row. col makes it clear that the table heading is for a column.

32
New cards

What does the colspan attribute do?

It allows data to span columns, the value must be greater than or equal to 1. Spanning columns can be understood as “how wide a data value is, i.e., the number of columns it takes up“

33
New cards

What does the rowspan attribute do?

It allows data to span rows, the value must be greater than or equal to 1. Spanning rows can be understood as “how tall a data value is, i.e., the number of rows it takes up“

34
New cards

What does the <tbody> tag do?

Long tables can be sanctioned off using the table body element <tbody>. The <tbody> tag should contain all of the table’s data, excluding the table headings!

35
New cards

What does the <thead> tag do?

When a table’s body is sectioned off, it also makes sense to section off the table’s column headings using the <thead> element. Note that the table’s head still requires a row in order to contain the table headings. Additionally, only the column headings go under the <thead> element. We can use the scope attribute on <th> elements to indicate whether a <th> element is being used as a "row" heading or a "col" heading.

36
New cards

What does the <tfoot> tag do?

The bottom part of a long table can also be sectioned off using the <tfoot> element.

37
New cards

What does the <form> tag do?

The <form> element is a great tool for collecting information, but then we need to send that information somewhere else for processing. We need to supply the <form> element with both the location of where the <form>‘s information goes and what HTTP request to make. The action attribute determines where the information is sent. The method attribute is assigned a HTTP verb that is included in the HTTP request.

38
New cards

What does the <input> tag do?

If we want to create an input field in our <form>, we’ll need the help of the

<input> element. The <input> element has a type attribute which determines how it renders on the web page and what kind of data it can accept.After users type into the <input> element, the value of the value attribute becomes what is typed into the text field. The value of the value attribute is paired with the value of the name attribute and sent as text when the form is submitted.

39
New cards

What is the purpose of the <label> tag? 

For a user to properly identify an <input> we use the appropriately named <label> element.To associate a <label> and an <input>, the <input> needs an id attribute. We then assign the for attribute of the <label> element with the value of the id attribute of <input>

40
New cards

When <input> is of type number what doe step do?

step creates arrows inside the input field to increase or decrease by the value of the step attribute

41
New cards

Checkboxes work well if we want to present users with multiple options and let them choose one or more of the options. However, there are cases where we want to present multiple options and only allow for one selection. Which type fits this best?

The radio type

42
New cards

What attribute in <input> is used to group checkboxes and radio options together?

The name attribute - each input must have the same name value in order to be grouped together. 

43
New cards

What is the purpose of <textarea>? 

44
New cards

What type do we use when we want to make <input> a submit button?

45
New cards

What attribute makes it so an <input> tag MUST have information in it?

The required attribute

46
New cards

What attribute allows us to set a maximum and minimum value in <input> for a number field?

To set a minimum acceptable value, we use the min attribute and assign a value. On the flip side, to set a maximum acceptable value, we assign the max attribute a value.

47
New cards

What attribute allows us to set a maximum and minimum value in <input> for a text field?

To set a minimum number of characters for a text field, we add the minlength attribute and a value to set a minimum value. Similarly, to set the maximum number of characters for a text field, we use the maxlength attribute and set a maximum value

48
New cards

What does the attribute pattern do?

49
New cards

What section of a site does the semantic tag <header> refer to?

A <header> is a container usually for either navigational links or introductory content containing <h1> to <h6> headings

50
New cards

What section of a site does the semantic tag <nav> refer to?

A <nav> is used to define a block of navigation links such as menus and tables of contents. It is important to note that <nav> can be used inside of the <header> element but can also be used on its own

51
New cards

What section of a site does the semantic tag <main> refer to?

The element <main> is used to encapsulate the dominant content within a webpage. This tag is separate from the <footer> and the <nav> of a web page since these elements don’t contain the principal content. By using <main> as opposed to a <div> element, screen readers and web browsers are better able to identify that whatever is inside of the tag is the bulk of the content

52
New cards

What section of a site does the semantic tag <footer> refer to?

The content at the bottom of the subject information is known as the footer, indicated by the <footer> element. The footer contains information such as:

  • Contact information

  • Copyright information

  • Terms of use

  • Site Map

  • Reference to top of page links

53
New cards

What section of a site does the semantic tag <section> refer to?

<section> defines elements in a document, such as chapters, headings, or any other area of the document with the same theme

54
New cards

What section of a site does the semantic tag <article> refer to?

The <article> element holds content that makes sense on its own. <article> can hold content such as articles, blogs, comments, magazines, etc. An <article> tag would help someone using a screen reader understand where the article content (that might contain a combination of text, images, audio, etc.) begins and ends.

55
New cards

What is the purpose of the semantic tag <aside>?

The <aside> element is used to mark additional information that can enhance another element but isn’t required in order to understand the main content. This element can be used alongside other elements such as <article>or<section>. Some common uses of the<aside>element are for:

  • Bibliographies

  • Endnotes

  • Comments

  • Pull quotes

  • Editorial sidebars

  • Additional information

56
New cards

What is the purpose of the semantic tag <figure>?

<figure> is an element used to encapsulate media such as an image, illustration, diagram, code snippet, etc, which is referenced in the main flow of the document.

57
New cards

What is the purpose of the semantic tag <figcaption>?

<figcaption> is an element used to describe the media in the<figure>tag. Usually,<figcaption>will go inside<figure>. This is different than using a<p>element to describe the content; if we decide to change the location of<figure>, the paragraph tag may get displaced from the figure while a<figcaption>will move with the figure. This is useful for grouping an image with a caption.

58
New cards

What is the purpose of the semantic tag <audio>?

The <audio> element is used to embed audio content into a document. Like <video>, <audio> uses src to link the audio source. We can use the attributes autoplay and controls to autoplay the audio or to include controls.

59
New cards

What is the purpose of the semantic tag <embed>?

Another tag that can be used to incorporate media content into a page is the <embed> tag, which can embed any media content including videos, audio files, and gifs from an external source. This means that websites that have an embed button have some form of media content that can be added to other websites. The <embed> tag is a self-closing tag, unlike the <video> element. Note that <embed> is a deprecated tag and other alternatives, such as <video>, <audio> and <img>, should be used in its place, but is being taught for legacy purposes.