-
Adding an Image to a Web Page
-
The role of images in a webpage
-
Specifying locations in web pages
-
Customizing Links
-
Exploring link options
-
Basic links
-
Why links?
-
Submit and Reset buttons
-
Multiline text boxes
-
Drop-down list fields
-
File upload fields
-
Hidden fields
-
Checkboxes and radio buttons
-
Password fields
-
Text fields
-
Input tags
-
Creating forms
-
How a form looks like?
-
Adding Headers Cells
-
Creating a Basic Table
-
Description list
-
Unordered list
-
Ordered list
-
Lists
-
More formatting elements
-
Other text elements
-
Working with language elements
-
Abbreviations, Definitions, Quotations and Citations
-
Creating Breaks
-
Basic text formatting elements
-
Creating a page from scratch using VS Code
-
Creating a page from scratch using Notepad
-
Setting Up the Basic Document Structure
-
Parents, Children, Descendants and Siblings
-
The Outer Structure of an HTML Document
-
Element Attributes
-
HTML elements
-
How HTML creates a website
-
Creating HTML markup
-
How a website works
-
Web Browsers vs Web Servers and Internet/HTTP
-
Webpage vs Website
The Outer Structure of an HTML Document
Elements and attributes don’t exist in isolation—we use them to mark up our content in an HTML document. The simplest way to create an HTML document is to create a text file—the convention is that these files have the .html file extension. We can then load the file into a browser, either directly from the disk or via a web server. An HTML document has a particular structure—we need to have some key elements in place as a minimum.
There are two elements that provide the outer structure of an HTML document—the DOCTYPE and html elements, as shown below.
<!DOCTYPE HTML>
<html>
<!-- elements go here -->
</html>
The DOCTYPE element tells the browser it is dealing with an HTML document. This is expressed through the HTML boolean attribute:
<!DOCTYPE HTML>
We follow the DOCTYPE element with the start tag of the html element. This tells the browser that the contents of the element should be treated as HTML all the way through until the html close tag.
The Metadata
The metadata region of an HTML document allows us to provide information about our document to the browser. The metadata is contained inside a head element, as shown below.
<!DOCTYPE HTML>
<html>
<head>
<!-- metadata goes here -->
<title>Example</title>
</head>
</html>
In the code, we have provided the minimum amount of metadata, which is the title element.
The Content
The third and final part of the document is the content, which we put inside a body element, as shown below.
<!DOCTYPE HTML>
<html>
<head>
<!-- metadata goes here -->
<title>Example</title>
</head>
<body>
<!-- content and elements go here -->
I like <code>apples</code> and oranges.
</body>
</html>
The body element tells the browser which part of the document is to be displayed to the user.