HTML 5 Flashcards
What is a text editor?
A text editor is a program that allows us to write code.
What does HTML stand for?
Hypertext Markup Language
What are the rules that every html file must follow (tags)?
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
</body>
</html>
What is the shortcut (in sublime) for quickly creating the default tags for html page?
Type html and hit the tab key.
<!DOCTYPE html>
All HTML documents must start with a <!DOCTYPE> declaration.The declaration is not an HTML tag. It is an “information” to the browser about what document type to expect.
What is the difference between a tag and an element?
HTML element is the collection of start tag, its attributes, an end tag and everything in between. An HTML tag (either opening or closing) is used to mark the start or end of an element
<b></b>
<b> tag is used to highlight in bold that part of the text, which we want to make more obvious for the user.</b>
<p>
</p>
This element creates a paragraph in html file.
<h1>
</h1>
This element creates a header in html file.
<strong></strong>
The strong element will bold a text. The <b> element was used in the past.</b>
<em></em>
The emphasis element will italicize text.
<ol>
</ol>
The <ol> tag defines an ordered list. An ordered list can be numerical or alphabetical.
Ex:
<ol>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
<ul>
</ul>
The <ul> tag defines an unordered (bulleted) list.
Ex:
<ul>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
What does the value attribute inside of an <li> element do?
The value attributes sets the numeric or alphabetic starting value of the items in an ordered list.
The value can be numeric, alphabetic, roman numerals, etc.
<ol>
<li>Paper</li>
<li>Pencils</li>
<li>Scissors</li>
<li>Erasers</li>
</ol>
<li>
</li>
The <li> HTML element is used to represent an item in a list. It must be contained in a parent element: an ordered list ( <ol> ), an unordered list ( <ul> ), or a menu ( <menu> ).
What are nested list?
Nested list are list inside of list.
Ex:
<ul>
<li>Coffee</li>
<li>Tea
<ul>
<li>Black tea</li>
<li>Green tea</li>
</ul>
</li>
<li>Milk</li>
</ul>
What are self closing tags?
A self-closing tag in HTML is a kind of HTML tag that does not need to be closed manually by its closing tag, which means it does not have a separate closing tag as </tag>
<br></br>
The <br></br> tag inserts a single line break. (There is no closing tag)
<hr></hr>
The <hr> HTML element represents a thematic break between paragraph-level elements: for example, a change of scene in a story, or a shift of topic within a section.
The <hr> element is most often displayed as a horizontal rule that is used to separate content (or define a change) in an HTML page.
<img></img>
The <img></img> tag is used to embed an image in an HTML page.
Images are not technically inserted into a web page; images are linked to web pages. The <img></img> tag creates a holding space for the referenced image.
What are the two required attributes for an <img></img> tag?
- src - Specifies the path to the image
- alt - Specifies an alternate text for the image, if the image for some reason cannot be displayed
What do attributes require?
Attributes require a name and a value.
Ex: <p lang= "en-us">Paragraph in English</p>
What are attributes?
An attribute in HTML provides additional information about an HTML element. It comes in a name and value pair with the structure name=”value”. For example, you can specify the width of an HTML element with the attribute width=”500”.
<a></a>
The anchor tag, used to specify the text that is the “anchor” for a link.
Ex:
<a>Learn to code!</a>
- or
- element?
On the 4th of September you will learn about E = MC2.
The amount of CO2 in the atmosphere grew by 2ppm in 2009.
td stands for table data. Each cell of a table is represented using a element.
|
58
|
The element is used just like the | element but its purpose is to represent the heading for either a column or a row. (th stands for table heading).
|
59
How can we use the scope attribute in a table?
The scope attribute can be used on the
element to indicate whether it is a heading for a column or row.
Ex:
| Saturday |
Tickets sold: |
60
colspan attribute
Table data can span columns using the colspan attribute.
61
rowspan attribute
Table data can span rows using the rowspan attribute.
62
What three sections can a table be split into?
a head, a body, and a footer.
63
A table’s head is created with the element.
64
A table’s body is created with the element.
65
A table’s footer is created with the element.
66
What are tags also called?
Markup
67
What is structural markup?
The elements that you can use to describe both headings and paragraphs.
68
The
69
The
70
What should you do with a page that has several articles (or even summaries of articles)?
If a page contains several articles, then each individual article would live inside its own article element.
71
What are some examples of nested articles?
A blog post might live inside one
72
(inside an article)
When the
73
(outside an article)
When the
74
Contains all types of media (images, videos, graphs, diagrams, code samples, text that supports the main body of an article). The figure element should also contain a
75
The
76
The
77
What is an empty element?
An element with no closing tag
78
The
79
The HTML element is used to create interactive controls for web-based forms in order to accept data from the user. Input is a self closing tag.
80
How do I create a input form that allows users to enter a text?
We create a form element and within our form element we add an input element and set the type to text.
Ex:
81
How do you create a form for a user's email?
We create a form element and within that element we add the input element. We set the type to email and include the value required to make adding an email required to continue.
Ex:
82
How do you create a form for a user's birthday?
We create a form element and within that element we add the input element. We set the type to date.
Ex:
83
How do we create a reset button?
We create a form element and within that element we add the input element and set the type to reset.
Ex:
84
How do we create radio buttons?
We create a form element and within that element we add the input element and set the type to radio. If we have multiple buttons, we need to use the name attribute. (each button should have the same name)
Ex:
85
How do we create checkboxes?
We create a form element and within that element we add the input element and set the type to checkbox.
Ex:
86
How do you create a dropdown field?
Create a select element and within that element add an option element. Set the value attribute to the option available in the dropdown field. Make sure to close the option tag.
Ex:
Cars:
|