Basic HTML Flashcards
!DOCTYPE
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.
html /html
The < html> tag represents the root of an HTML document.The < html> tag is the container for all other HTML elements (except for the < !DOCTYPE> tag).
head /head
Contains metadata/information for the document.
The element is a container for metadata (data about data) and is placed between the tag and the tag.
Metadata is data about the HTML document. Metadata is not displayed.
Metadata typically define the document title, character set, styles, scripts, and other meta information.
The following elements can go inside the < head> element:
- < title> (required in every HTML document)
- < style>
- < base>
- < link>
- < meta>
- < script>
- < noscript>
title /title
Defines a title for the document
The < title> tag defines the title of the document. The title must be text-only, and it is shown in the browser’s title bar or in the page’s tab
body /body
Defines the document’s body.
The < body> element contains all the contents of an HTML document, such as headings, paragraphs, images, hyperlinks, tables, lists, etc.
h1 to h6
Defines HTML headings
Tip: Use h1 to h6 elements only for headings. Do not use them just to make text bold or big. Use other tags for that.
p /p
Defines a paragraph.
Browsers automatically add a single blank line before and after each < p> element.
br
Inserts a single line break.
hr
(Horizontal Rule)
Defines a thematic change in the content.
The < hr> tag defines a thematic break in an HTML page (e.g. a shift of topic).
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.
!–…–
Defines a comment.