HTML Flashcards
What does HTML stand for?
Hyper Text Markup Language
What is a markup language?
A computer language that uses tags to define elements with a document.
What does HTML consist of?
HTML consists of a series of elements.
What is the declaration element of a HTML page which defines a document?
<!DOCTYPE html>
What is a element which we call the root element of a HTML page?
<html>
</html>
What is the element that contains information about the HTML header in the page?
<head>
</head>
What is the element that specifies a title for the HTML page (which is shown in the browser’s title bar or in the page’s tab)?
<title>
</title>
Wht is the element that defines a document’s body? It is the container for all visible content (headings images, tables, etc.)
<body>
</body>
What is the element that defines a large heading?
<h1>
</h1>
What is the element that defines a paragraph?
<p>
</p>
How is a HTML defined?
By a start tag and end tag <tagname> Content goes here...</tagname>
Are HTML elements case sensitive?
No
What must all HTML document start with?
A document type declaration <!DOCTYPE html>
What does the HTML begin with and end with?
The root element <html> </html>
What is the visible part of the HTML document?
It’s sandwiched between <body> and </body>
How many types of headings sizes are there?
6 (ex. <h1> </h1>, <h6></h6>)
How can you change the default size of a HTML heading?
Using a CSS font-size property (ex. <h1 style="font-size:60px;"> Heading 1</h1>
What is an HTML attribute?
All HTML elements have attributes which provide additional information about elements
What do HTML attributes come in?
name/value pairs like name=”value”
What is a HTML style attribute used for?
To add styles to an element, such as color, font, size, and more.
What syntax does the HTML style attribute have?
<tagname> (ex. <p> I am red</p>
</tagname>
What is the syntax for the image tag?
<img></img>
What is the src part of a image syntax?
Specifies the path (URL) to the image (required)
What is the alt part of the image syntax?
Specifies an alternate text for the image (if the browser cannot find the image)
How would you add a style attribute to specify the width and height of an image?
<image>
</image>
What is the HTML link syntax?
<a>link text</a>
How would you hyperlink an image?
Put the <img></img> tag inside the <a> tag (ex. <a href=”link”<img src-“image example.gif” alter = “HTML Chapter” </a>
What is the HTML form element?
It is a container for different types of input elements such as: text fields, checkboxes, radio buttons, submit buttons etc.
What is the syntax for the form element?
<form> </form>
What is the most used form element?
<input></input>
What is the syntax for a type attribute?
<input></input>
What are the most used type attributes?
Text, radio, checkbox, submit, button, and password
What must a type attribute have for text?
A name (require to send to server), value (initial value), and ID Attribute (unique ID in HTML document)
What’s the syntax for a first name text attribute?
First name: <input type = “text” name = “first_name” value = “John”
What’s the syntax for a submit attribute?
<input></input>
What is the syntax for a Radio input type?
<input></input> HTML
What is the syntax for a checkbox attribute type?
<input></input> HTML
What is the syntax for a button with an alert?
<input type=”button onclick=”alert(‘Hello World!’)” value=”Click Me!”>
What is the syntax for a text box that exceeds a single sentence?
<textarea> enter description here. </textarea>
What is the syntax for a dropdown list?
<select id=”cars” name=”cars”?
<option>Audi</option>
</select>
What is the fieldset element used for?
To group related data in a form
What is the syntax for a fieldset element?
<fieldset> </fieldset>
What does a legend element do?
It defines a caption for the <fieldset> element
What is the syntax for a legend element?
<legend> </legend>
What is the syntax for a email input type element?
<label for=”email>Enter your email:</label>
<input></input>
What does a label element do?
It creates a caption for form control
What are the 2 types of ways to pair label with an input?
Implicit and Explicit
What is an implicit label?
It wraps the input in a label (ex. <label>
Name:
<input></input>
</label>
What is an explicit label?
It adds an attribute to the label and an id to the input
<label>Name: </label>
<input></input>
What is the input type syntax for a date?
<input></input>
What is the input type syntax for a month drop-down?
<input></input>
What is the input type syntax for a number input field?
<input type=”number” id=”quantity” name=”quantity” min=”1” max=5”>
What is the size attribute?
It specifies the vidsible width, in characters, of an input field
What is the default value for a size attribute?
20
What is the a syntax example of using a size attribute with a text input attribute?
<input></input>
What is a place holder attribute?
It specifies a short hint that describes the expected value of an input field.
What is the syntax for a placeholder attribute for a telephone input?
<input type=”tel” id=”phone” name=”phone” placeholder=”123-45-678”
What is a required attribute?
It specifies that an input field must be filled out before submitting the form.
What is some example syntax of a required attribute with a text input element?
<input></input>
What is the autofocus attribute?
It specifies that an input field should automatically get focus when a page loads.
What does a <datalist> element show?</datalist>
The input list attribute refers to a <datalist> element that contains pre-defined values for an <input></input> element</datalist>
What’s an example of a datalist element with a input list?
<input></input> <datalist>
<option>
</datalist></option></datalist>
What is the syntax for a reset button?
<input></input>
What is the range input type?
It can be used for entering a numerical value within a specific range
What is an syntax example of a range input type?
<input></input>
What is the time input type?