HTML File Structure
<!-- Tells the browser that this file contains HTML5 code -->
<!DOCTYPE html>
HTML File Structure
<!-- Tells the browser that this file contains HTML5 code -->
<!DOCTYPE html>
<!-- The HTML document root -->
<html>
</html>HTML File Structure
<!-- Tells the browser that this file contains HTML5 code -->
<!DOCTYPE html>
<!-- The HTML document root -->
<html>
<!-- This is where we setup the document's
metadata information -->
<head>
</head>
</html>HTML File Structure
<!-- Tells the browser that this file contains HTML5 code -->
<!DOCTYPE html>
<!-- The HTML document root -->
<html>
<!-- This is where we setup the document's
metadata information -->
<head>
<!-- For example, the document title
that is displayed on the tab -->
<title>Document Title</title>
</head>
</html>HTML File Structure
<!-- Tells the browser that this file contains HTML5 code -->
<!DOCTYPE html>
<!-- The HTML document root -->
<html>
<!-- This is where we setup the document's
metadata information -->
<head>
<!-- For example, the document title
that is displayed on the tab -->
<title>Document Title</title>
</head>
<!-- This where where we setup the document's
body and start building our page components! -->
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>HTML File Structure
<!DOCTYPE html>
<html>
<head>
<title>Document Title</title>
</head>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>Clean up all the comments and the file should look like:
HTML File Structure
<meta> tag defines metadata about an HTML document
HTML File Structure
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Free Web tutorials">
<meta name="keywords" content="HTML, CSS, JavaScript">
<meta name="author" content="John Doe">
<title>Page Title</title>
</head>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>HTML File Structure
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Free Web tutorials">
<meta name="keywords" content="HTML, CSS, JavaScript">
<meta name="author" content="John Doe">
<title>Page Title</title>
</head>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>Required
HTML File Structure
<meta charset="UTF-8">
HTML File Structure
<meta name="viewport" content="width=device-width, initial-scale=1.0">
width=device-width sets the width of the page to follow the width of the device initial-scale=1.0 sets the initial zoom level when the page first renders into the browserHTML File Structure
Your HTML file should always start like this:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Page Title</title>
</head>
<body
<!-- HTML elements go in here -->
</body>
</html>HTML File Structure
! in your editor,Tab
Practice: HTML File Structure
h1 heading of your nameh2 heading of your current job title HTML File Paths
<a href="https://classroom.udacity.com/me">My Udacity Classroom</a><img src="https://via.placeholder.com/200.png" alt="Code Background" /><img src="./images/image.png" alt="Image on local machine" />HTML File Paths
HTML File Paths
A path that defines the full web address to a file resource usually from an external server.
For example, the absolute link to retrieve an image from another website looks like this:
https://www.example.com/images/picture.jpg
www.example.com, look in the images folder, and access the file named picture.jpg
HTML File Paths
A path that defines the relative path address to a file resource's location based on the current working file.
There are two types of file-relative paths in HTML:
./
../
HTML File Paths
There is a third type of file-relative path, a root-relative path.
/ character
Users folder on a Mac; the C:\ drive on Windows)❌ NOT RECOMMENDED
Concept Practice: Relative Paths
Lab: Basic HTML Page
CSS Foundations