HTML
HTML
Basics of HTML
Lesson 1
Building Your First Web Page
Before we begin our journey to learn how to build websites with HTML and CSS, it is
important to understand the differences between the two languages, the syntax of each
language, and some common terminology.
What Are HTML & CSS?
HTML, HyperText Markup Language, gives content structure and meaning by
defining that content as, for example, headings, paragraphs, or images.
CSS, or Cascading Style Sheets, is a presentation language created to style the
appearance of content—using, for example, fonts or colors.
As a rule, HTML will always represent content, and CSS will always represent the
appearance of that content.
With this understanding of the difference between HTML and CSS, let’s dive into
HTML in more detail.
Example Code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Hello World</title>
</head>
<body>
<h1>Hello World</h1>
<p>This is a web page.</p>
</body>
</html>
Understanding Common HTML Terms
Elements
Elements are designators that define the structure and content of objects
within a page. Some of the more frequently used elements include multiple levels
of headings and paragraphs, the list goes on to include
the <a>, <div>, <span>, <strong>, and <em>elements, and many more.
Elements are identified by the use of less-than and greater-than angle brackets, < >,
surrounding the element name.
Tags and Attributes
An opening tag marks the beginning of an element. It consists of a less-than sign
followed by an element’s name, and then ends with a greater-than sign; for
example,<div>.
A closing tag marks the end of an element. It consists of a less-than sign
followed by a forward slash and the element’s name, and then ends with a
greater-than sign; for example, </div>.
The content that falls between the opening and closing tags is the content of that
element.
Attributes are properties used to provide additional information about an
element.
Attributes are defined within the opening tag, after an element’s name. Generally
attributes include a name and a value. The format for these attributes consists of
the attribute name followed by an equals sign and then a quoted attribute value.
For example, an <a> element including an href attribute would look like the
following:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Hello World</title>
</head>
<body>
<h1>Hello World</h1>
<p>This is a web page.</p>
</body>
</html>
THANKS