Basic Flashcards
With HTML you can create your own Web site. This tutorial teaches you everything about HTML. HTML is easy to learn - You will enjoy it. (54 cards)
What is HTML?
HTML stands for Hyper Text Markup Language
HTML Elements
An HTML element is everything between the start tag and the end tag.
The <!DOCTYPE> Declaration
The <!DOCTYPE> declaration helps the browser to display a web page correctly.
Doctype for HTML5
<!DOCTYPE html>
HTML Images
HTML images are defined with the <img></img> tag.
<img></img>
HTML Links
HTML links are defined with the <a> tag.</a>
<a>This is a link</a>
HTML Paragraphs
HTML paragraphs are defined with the <p> tag.
HTML Headings
HTML headings are defined with the <h1> to <h6> tags.
HTML Element Syntax
An HTML element starts with a start tag / opening tag
An HTML element ends with an end tag / closing tag
The element content is everything between the start and the end tag
Some HTML elements have empty content
Empty elements are closed in the start tag
Most HTML elements can have attributes
Proper way of closing empty elements in XHTML
HTML elements with no content are called empty elements.
<br></br> is an empty element without a closing tag (the <br></br> tag defines a line break).
Tip: In XHTML, all elements must be closed. Adding a slash inside the start tag, like <br></br>, is the proper way of closing empty elements in XHTML (and XML).
Use Lowercase Tags, Why?
W3Schools use lowercase tags because the World Wide Web Consortium (W3C) recommends lowercase in HTML 4, and demands lowercase tags in XHTML.
HTML Attributes
HTML elements can have attributes
Attributes provide additional information about an element
Attributes are always specified in the start tag
Attributes come in name/value pairs like: name=”value”
HTML Lines
The <hr>tag creates a horizontal line in an HTML page.
HTML Comments
Comments can be inserted into the HTML code to make it more readable and understandable. Comments are ignored by the browser and are not displayed.
Example:
<!-- This is a comment -->
HTML Line Breaks
Use the <br></br> tag if you want a line break (a new line) without starting a new paragraph.
The <br></br> element is an empty HTML element. It has no end tag.
<p>
</p>
Defines a paragraph.
<br></br>
Inserts a single line break.
Defines an HTML document.
Defines the document’s body.
<hr></hr>
Defines a horizontal line.
<!–>
Defines a comment.
class
Specifies one or more classnames for an element (refers to a class in a style sheet).
id
Specifies a unique id for an element.
style
Specifies an inline CSS style for an element.