Learn HTML_ Elements and Structure Cheatsheet _ Codecademy
Learn HTML_ Elements and Structure Cheatsheet _ Codecademy
HTML
HTML (HyperText Markup Language) is used to
give content to a web page and instructs web
browsers on how to structure that content.
Element Content
The content of an HTML element is the
information between the opening and closing <h1>Codecademy is awesome! 🙂</h1>
tags of an element.
<ul>
<li>Cookies</li>
<li>Milk</li>
</ul>
<video> Video Element
The <video> element embeds a media player
for video playback. The src attribute will <video src="test-video.mp4"
contain the URL to the video. Adding the controls>
controls attribute will display video controls Video not supported
in the media player. </video>
Note: The content inside the opening and
closing tag is shown as a fallback in browsers
that don’t support the element.
Closing Tag
An HTML closing tag is used to denote the end
of an HTML element. The syntax for a closing <body>
tag is a left angle bracket < followed by a ...
forward slash / then the element name and </body>
a right angle bracket to close > .
Attribute Name and Values
HTML attributes consist of a name and a value
using the following syntax: name="value" and <elementName name="value">
can be added to the opening tag of an HTML </elementName>
element to configure or change the behavior
of the element.
HTML Tag
The syntax for a single HTML tag is an opening
angle bracket < followed by the element <div>
name and a closing angle bracket > . Here is
an example of an opening <div> tag.
<a> Anchor Element
The <a> anchor element is used to create
hyperlinks in an HTML document. The <!-- Creating text links -->
hyperlinks can point to other webpages, files <a
on the same server, a location on the same href="http://www.codecademy.com">V
page, or any other URL via the hyperlink isit this site</a>
reference attribute, href . The href
determines the location the anchor element
<!-- Creating image links -->
points to.
<a
href="http://www.codecademy.com">
<img src="logo.jpg">Click this
image
</a>
<head> Head Element
The <head> element contains general
information about an HTML page that isn’t <!DOCTYPE html>
displayed on the page itself. This information <html>
is called metadata and includes things like the <head>
title of the HTML document and links to <!-- Metadata is contained in
stylesheets.
this element-->
</head>
</html>
<a href="#id-of-element-to-link-
to">Take me to a different part of
the page</a>