Introduction to HTML | An HTML5 Tutorial for Beginners

Dave Gray
14 Dec 202120:21

Summary

TLDRIn this informative tutorial, Dave introduces beginners to the fundamentals of web development by explaining what HTML is and its role as the basic building block of the web. He guides viewers through setting up the necessary tools, such as Google Chrome and Visual Studio Code, and demonstrates how to create a simple HTML file. Dave emphasizes the importance of proper file naming conventions and introduces the structure of an HTML document, including the head and body sections. He also touches on the use of CSS for basic styling and highlights the utility of the Live Server extension for real-time web page viewing. The video concludes with a validation check using the W3C Markup Validation Service to ensure the HTML code is error-free.

Takeaways

  • πŸš€ HTML is the most basic building block of the web, defining the meaning and structure of web content.
  • πŸ”— Hypertext refers to links that connect web pages to each other, either within a single site or across different sites.
  • πŸ–‹οΈ Markup is used in HTML to annotate text, images, and other content for display in a web browser.
  • 🌐 Google Chrome is recommended as a web browser for web development, along with the Dark New Tab extension for a better user experience.
  • πŸ’» Visual Studio Code is the preferred code editor for this tutorial series, and it's available for free across multiple platforms.
  • πŸ“ Create a folder on your computer to organize your HTML files and other development-related files.
  • πŸ“ Start every HTML document with an opening and closing `html` tag, containing a `head` for metadata and a `body` for visible content.
  • πŸ”Š The `title` element within the `head` defines the title of the web page displayed in the browser's title bar.
  • πŸ“Œ Use semantic tags like `h1` for headings and `p` for paragraphs to structure the content within the `body`.
  • 🎨 CSS can be added within a `style` element in the `head` to apply styling to your web page.
  • πŸ”„ Live Server extension for Visual Studio Code allows for live reloading of web pages as you make changes during development.
  • βœ… Use the W3C Markup Validation Service to check your HTML for errors and warnings, ensuring your code adheres to web standards.

Q & A

  • What is the main purpose of this tutorial series?

    -The main purpose of this tutorial series is to guide beginners in their journey of learning web development, provide an HTML resource for sharing with others who are starting their web development journey, or serve as a refresher course for those who have previously learned HTML but need a review.

  • What does HTML stand for and what is its role on the web?

    -HTML stands for Hypertext Markup Language. It is the most basic building block of the web, defining the meaning and structure of web content. Hypertext refers to links that connect web pages to each other, either within a single website or from one website to another.

  • What are the two main areas of an HTML page?

    -The two main areas of an HTML page are the head area, which contains metadata about the page, and the body area, which holds the content visible to users in the browser.

  • What is the recommended code editor for this tutorial series?

    -The recommended code editor for this tutorial series is Visual Studio Code, which can be downloaded for free from the official website.

  • Why is it important to use lowercase and hyphens in file naming for web pages?

    -Using lowercase and hyphens in file naming is important because web servers differentiate between cases and may cause problems if spaces or mixed case are used. The convention is to use lowercase, no spaces, and hyphens, ending each file with .html.

  • What is the function of the 'lang' attribute in the HTML start tag?

    -The 'lang' attribute in the HTML start tag declares the language of the document, which is important for accessibility and search engine optimization. For example, setting it to 'en' indicates that the document is in English.

  • What does the 'meta' element inside the 'head' section do?

    -The 'meta' element inside the 'head' section stores metadata about the page, such as character encoding, which is specified using the 'charset' attribute with the value 'utf-8' for Unicode.

  • Why is a 'DOCTYPE' declaration necessary at the beginning of an HTML file?

    -A 'DOCTYPE' declaration is necessary at the beginning of an HTML file to inform the browser about the version of HTML being used. It helps ensure that the browser renders the page correctly according to the specified standard.

  • How does the Live Server extension help in web development?

    -The Live Server extension helps in web development by automatically reloading the web page in the browser whenever changes are made to the code, allowing developers to see updates in real-time without manually refreshing the page.

  • What is the W3C Markup Validation Service and how is it used?

    -The W3C Markup Validation Service is a tool provided by the World Wide Web Consortium that checks HTML documents for errors and warnings. It helps developers ensure that their web pages adhere to web standards and are free from common mistakes.

  • What are some recommended extensions for Visual Studio Code to enhance web development experience?

    -Some recommended extensions for Visual Studio Code to enhance web development include 'Dark New Tab' for a dark-themed new tab page, 'vscode-icons' for file and folder icons, 'GitHub Theme' for a dark or light theme based on GitHub's style, and 'Live Server' for live previewing of web pages.

Outlines

00:00

πŸš€ Introduction to Web Development

This paragraph introduces the tutorial series aimed at beginners in web development, those seeking an HTML resource, or individuals needing a refresher course. The speaker, Dave, welcomes all and mentions that he will provide references and tools with links in the description. The tutorial begins with an explanation of HTML as the fundamental building block of the web, defining the structure and meaning of web content. It also touches on the importance of using a web browser and code editor, specifically mentioning Google Chrome and Visual Studio Code, and provides instructions on how to set up these tools for the learning process.

05:03

πŸ“š Creating Your First HTML Document

In this paragraph, Dave guides viewers through the process of creating their first HTML document. He explains the structure of an HTML page, including the 'html', 'head', and 'body' elements. The 'head' section is for metadata, while the 'body' contains the visible page content. Dave emphasizes the importance of naming conventions for HTML files, such as using lowercase and avoiding spaces. He demonstrates how to create an 'index.html' file, add a 'title' element, and write an 'h1' heading and a 'p' paragraph element within the HTML structure. The paragraph concludes with a brief mention of code formatting and extensions for Visual Studio Code.

10:03

🌐 Viewing and Styling Your Web Page

This section focuses on viewing the created web page and enhancing its appearance with basic styling. Dave explains how to use the Live Server extension in Visual Studio Code to view the web page in a browser. He also discusses the importance of a development server for local testing. To improve the visual experience, Dave adds a 'style' element within the 'head' section and applies simple CSS to change the font size, background color, and text color. The paragraph highlights the convenience of Live Server's automatic reloading feature and the process of viewing web pages locally as opposed to hosting them on a web server.

15:05

πŸ” Validating Your HTML Code

Dave introduces the concept of validating HTML code to ensure there are no errors or warnings. He uses the W3C Markup Validation Service to check the 'index.html' file and identifies several issues that need to be fixed. These include adding a 'lang' attribute to the 'html' tag to declare the document's language, specifying the character encoding with a 'meta' element, and including a doctype declaration at the beginning of the HTML file. After making these changes and re-validating the code, Dave demonstrates that the document is now free of errors and warnings, emphasizing the importance of continuous improvement in web development.

20:07

πŸŽ‰ Conclusion and Encouragement

In the final paragraph, Dave concludes the tutorial by encouraging viewers to like the video if they found it helpful and to subscribe for more content. He thanks the audience for watching and expresses his enthusiasm for continuing the journey of writing code together. This paragraph serves as a motivational closing remark, highlighting the progress made throughout the tutorial and the community aspect of learning to code.

Mindmap

Keywords

πŸ’‘Web Development

Web development refers to the process of creating and maintaining websites or web applications. It encompasses a variety of skills and technologies, including HTML, CSS, JavaScript, and server-side programming languages. In the video, the host is guiding beginners through the foundational aspects of web development, starting with learning HTML, which is the most basic building block of the web.

πŸ’‘HTML

HTML, or Hypertext Markup Language, is the standard markup language used to create web pages. It defines the structure and layout of a web page by using a series of tags and attributes. HTML is essential for web development as it forms the backbone of any website, allowing developers to organize and format content for display in web browsers.

πŸ’‘Markup Language

A markup language is a system for annotating a document in a way that the document's content can be displayed in a particular way. HTML is an example of a markup language, which uses tags to define elements and structure on web pages. Markup languages are crucial for web development as they dictate how content is presented and organized in a browser.

πŸ’‘Web Browser

A web browser is a software application used to access and display web pages on the internet. It interprets the HTML code and other web technologies to present content to the user in a readable and interactive format. Examples of web browsers include Google Chrome, Mozilla Firefox, Safari, and Microsoft Edge.

πŸ’‘Code Editor

A code editor is a specialized text editor designed for writing and editing source code. It often includes features like syntax highlighting, auto-indentation, and code completion, which aid developers in writing code more efficiently and with fewer errors. In the context of web development, a code editor like Visual Studio Code is used to write HTML, CSS, and JavaScript files.

πŸ’‘Dark Mode

Dark mode is a display setting that changes the color scheme of a user interface to predominantly dark colors, which can reduce eye strain and improve readability in low-light conditions. Many applications, including web browsers and code editors, offer dark mode options to provide a more comfortable viewing experience for users who prefer it.

πŸ’‘Extensions

Extensions, in the context of web browsers, are small software programs that add additional features or functionality to the browser. They can enhance the user experience by providing tools for productivity, customization, or improved browsing capabilities. For example, browser extensions can help manage tabs, block advertisements, or format code more efficiently.

πŸ’‘Live Server

Live Server is a browser extension that allows web developers to view their web pages in real-time as they make changes to the code. It automatically reloads the web page in the browser whenever a change is saved in the code editor, providing a convenient way to test and debug web pages without manually refreshing the browser.

πŸ’‘W3C Markup Validation Service

The W3C Markup Validation Service is an online tool provided by the World Wide Web Consortium (W3C) that checks HTML and XHTML documents for errors and warnings. It ensures that the markup adheres to web standards, promoting accessibility, compatibility, and best practices in web development. Using this service helps developers identify and fix issues in their code, resulting in better-quality web pages.

πŸ’‘DOCTYPE Declaration

A DOCTYPE declaration is a special instruction at the beginning of an HTML document that tells the web browser about the version of HTML being used. It is an essential part of the document that ensures the browser renders the page correctly according to the specified HTML standard. The DOCTYPE declaration is not an HTML element or tag but a directive that must be placed at the very start of the document.

πŸ’‘Language Attribute

The language attribute, when added to the 'html' start tag, specifies the natural language of the document's content. This attribute helps assistive technologies and search engines better understand the content's language, improving accessibility and search engine optimization. The value 'en' represents English, and other values can represent different languages or dialects.

Highlights

The tutorial series is designed for beginners in web development, those looking for an HTML resource, or individuals seeking a refresher course.

HTML stands for Hypertext Markup Language and is the fundamental building block of the web, defining the structure and meaning of web content.

Hypertext refers to links that connect web pages to each other, either within a single website or across different websites.

Markup is used in HTML to annotate text, images, and other content for display in a web browser.

The Google Chrome browser and the Dark New Tab extension are recommended for a better development experience.

Visual Studio Code is the preferred code editor for this tutorial series and can be downloaded for free.

A new folder should be created on your computer to store your HTML files, and the first file should be named index.html.

File names should be in lowercase with no spaces, and they should end with .html.

Every HTML page starts with an html element, which contains a head section for metadata and a body section for visible page content.

The title element within the head section defines the title of the page, which is displayed in the browser tab.

The h1 element is used for the main heading of the page, typically used once to describe what the page is about.

The p element stands for paragraph and is used to add text content to the page.

The Live Server extension for Visual Studio Code allows for real-time viewing of web pages as you make changes.

The W3C Markup Validation Service can be used to check for errors and validate HTML code.

Adding a lang attribute to the html start tag is recommended to declare the language of the document.

Character encoding should be declared within the head section using a meta element with the charset attribute set to UTF-8.

A doctype declaration is required at the beginning of every HTML file to specify the document type.

After addressing validation warnings and errors, the document should be rechecked to ensure there are no remaining issues.

The tutorial emphasizes the importance of continuous learning and improvement in web development.

Transcripts

play00:00

[Music]

play00:05

hello and welcome hi i'm dave this

play00:07

tutorial series is for you if you are

play00:10

just beginning your journey towards

play00:11

learning web development

play00:13

or maybe you're looking for an html

play00:15

resource to share with a friend who is

play00:17

just beginning their journey towards

play00:19

learning web development

play00:21

or you may be looking for a refresher

play00:23

course because you previously learned

play00:25

html but it has been a few semesters or

play00:28

even years since you looked at it or

play00:30

maybe you have another reason that i

play00:32

haven't even thought of no matter you're

play00:34

welcome and i hope i help you on your

play00:36

journey throughout the tutorial i will

play00:38

mention some references and tools and i

play00:41

will provide links to everything i

play00:42

mention in the description below let's

play00:45

get started learning html

play00:48

what is html

play00:50

html is an acronym that stands for

play00:53

hypertext markup language

play00:56

and hypertext markup language html is

play00:59

the most basic building block of the web

play01:02

it defines the meaning and structure of

play01:04

web content

play01:06

and hypertext refers to links that

play01:08

connect web pages to each other and that

play01:10

can be within a single website or from

play01:13

one website to another overall html uses

play01:17

markup to annotate text images and other

play01:19

content for display in a web browser and

play01:22

you can see an example of some of these

play01:24

markup elements here but before we begin

play01:27

creating a web page and using these

play01:29

markup elements we need to get the

play01:31

necessary tools so let's start with a

play01:33

web browser if you don't have one or if

play01:36

you're curious what i will be using in

play01:37

this series i'll be using the google

play01:40

chrome browser and you can download that

play01:42

at google.com

play01:44

chrome so if you don't have that and

play01:46

want to use that go ahead and download

play01:49

and install now and then come back to

play01:51

the tutorial

play01:52

also i will be using an extension

play01:55

and we go to chrome.google.com

play02:00

webstore to get extensions for the

play02:02

chrome browser and there if you want to

play02:04

use the extension that i'm going to use

play02:06

it's called dark new tab and you can

play02:10

press enter to search for that and once

play02:12

you've completed your search you'll see

play02:14

dark new tab offered by keller which is

play02:16

the one that i have added and you can

play02:18

see added here i'll click on that

play02:21

and once you're inside the page for dark

play02:23

new tab you should have an install

play02:25

button here since i already have it

play02:27

installed

play02:28

this is now a remove button for me what

play02:30

this does is when you open a new tab in

play02:33

the browser it uses a dark page instead

play02:36

of a light page and i use dark mode

play02:38

whenever possible so i prefer that if

play02:40

you see me open a new tab in this

play02:43

development series you'll probably see a

play02:46

dark tab like this one from there we

play02:48

need to get a code editor and the

play02:51

industry standard right now and what i

play02:53

prefer to use is visual studio code

play02:55

again you can use other code editors to

play02:58

write your html code but if you go to

play03:01

code dot visual studio

play03:05

you'll be able to download visual studio

play03:07

code for free

play03:08

and there you can download for windows

play03:10

if you're on windows like i am or you

play03:12

can click other platforms and it's also

play03:15

available for linux and mac os so now

play03:18

would be a good time to go ahead and

play03:21

download visual studio code and install

play03:24

your code editor and go ahead and open

play03:27

that up and then come back to the video

play03:30

okay i am now assuming you have

play03:32

installed visual studio code and have

play03:34

opened it up and you may see something

play03:36

like this or you may see a welcome

play03:38

screen

play03:39

what you need to do is create a folder

play03:42

on your computer

play03:44

and we will put our files inside that

play03:46

folder so if i go to the file menu and

play03:49

choose open folder

play03:51

you can see once this pops up

play03:53

what folder i am in the html course

play03:56

folder in windows and then i've created

play03:59

an 0-1 underscore lesson folder so if i

play04:03

highlight that and select the folder

play04:05

i am now inside that folder and ready to

play04:08

create my first html file

play04:10

so if you see the file tree over here on

play04:13

the left and it's currently empty if you

play04:15

don't click this icon in the top left

play04:17

which is the file explorer and that will

play04:19

hide or show this file explorer we're

play04:22

going to create the plus button or click

play04:24

the plus button here for new file and

play04:26

create a new file

play04:28

now we'll type index

play04:30

dot html as that is always the file name

play04:35

that is expected to launch a website and

play04:38

you always want to keep your file names

play04:40

lower case and with no spaces now

play04:43

windows will not complain if you put a

play04:45

space or use upper or lower case however

play04:48

when we host our files on a web server a

play04:51

web server will differentiate many times

play04:54

and that could cause problems so the

play04:56

naming convention is to always use lower

play04:59

case no spaces you can use hyphens

play05:02

dashes

play05:03

and then end each file in dot html

play05:07

okay we have an empty index.html file

play05:10

let's create our first html element and

play05:14

as you might guess the first html

play05:17

element we'll create is html so if we

play05:20

type html all lowercase and press tab in

play05:24

visual studio code it creates the tags

play05:27

and by tags that is often interchanged

play05:30

as a word with element however the

play05:32

element consists of the starting and

play05:34

ending tag and everything in between but

play05:37

here we might just be referring to the

play05:40

starting also called the opening tag or

play05:42

the ending also called the closing tag

play05:46

so we refer to html tags but every page

play05:49

starts and ends with the html opening

play05:53

and closing tags and everything else on

play05:56

the page goes between those tags after

play05:59

creating our html element html pages

play06:02

have two main areas

play06:04

and one area contains data that is not

play06:07

seen on the page but is considered to be

play06:09

metadata about the page and that is the

play06:13

head area so just type head not header

play06:16

but head and press tab

play06:18

and now we have our head element

play06:21

and we will put metadata about the page

play06:24

inside this area

play06:25

but the next area is the page that every

play06:28

or is the part of the page that

play06:30

everybody sees in the browser and that

play06:33

is held within

play06:34

the body element so type body and press

play06:37

tab and now we have our two major

play06:40

sections of our page that are both

play06:42

inside of the html element we have a

play06:45

head section and a body section now

play06:48

inside the head we'll just put one piece

play06:50

of metadata today and it really won't

play06:52

start with the word meta we'll come back

play06:54

to that word in the future we're going

play06:56

to create a title element

play06:59

and give our page a title let's just

play07:01

call this my first

play07:04

web page

play07:05

and this will stay inside

play07:08

of the html document now i just pressed

play07:10

ctrl s which saved the document you

play07:14

otherwise would see a dot up here by the

play07:16

index.html so i saved that and i am

play07:20

using an auto formatter visual studio

play07:23

code may or may not do that for you when

play07:25

you save your file if you want that you

play07:29

can go to the extension

play07:32

icon over here and search

play07:34

for a prettier extension

play07:37

and i'm not sure if mine is enabled or

play07:39

i'm using something else right now we'll

play07:40

have to check now mine is disabled but i

play07:43

do recommend this one prettier is a code

play07:45

formatter that will auto format your

play07:47

code but visual studio code may do some

play07:50

of that as well but if you want to use

play07:52

prettier go ahead and click install and

play07:54

you can use that as well

play07:56

so i'll close out that prettier tab go

play07:59

back to the file explorer here so we see

play08:02

our index.html on the left instead of

play08:05

the extensions

play08:06

and now we can see our html is formatted

play08:10

in a very easy to read manner we have

play08:12

our html element and then the head

play08:16

element and then the body element and

play08:18

they're separated by spaces very easy to

play08:21

read and we have a title inside of the

play08:23

head again the title will not be seen

play08:26

inside of the browser in the body of the

play08:28

page but i will show you very shortly

play08:31

where we do see it

play08:32

inside of the body element though let's

play08:34

put an h1 element which stands for a

play08:37

heading and it is the biggest heading we

play08:40

could put you only put one h1 element

play08:43

per page and that should be saying what

play08:45

your page is about it doesn't

play08:47

necessarily have to be the same text

play08:50

that is in the title but here we're just

play08:52

going to put hello world as is the

play08:54

tradition for creating your first file

play08:57

in any language you're learning and so

play09:00

we have hello world on the page and we

play09:03

have my first web page in the head

play09:05

section let's add one more element in

play09:08

the body of the page

play09:10

and this is a paragraph element that

play09:12

starts and ends just with the letter p

play09:15

but notice each of our tags of course

play09:17

start with this

play09:19

less than and then end with the greater

play09:22

than and then the ending tag you'll

play09:24

notice has a slash but all we have to do

play09:26

in visual studio code is type p and

play09:29

press tab and it creates both for us so

play09:32

we're going to put some text inside of

play09:35

our paragraph and here we'll just put

play09:38

this is

play09:39

my first

play09:41

web page with a period to end the

play09:43

sentence and save once again i'm

play09:46

pressing ctrl s on the keyboard to save

play09:49

you can go to the file menu and from

play09:51

there you can also choose save but

play09:53

you'll notice the shortcut is control

play09:56

and the letter s we're almost ready to

play09:58

view our web page but before we do

play10:01

remember the extensions we went to i

play10:03

want to show you just a few if you want

play10:05

your visual studio code to look like

play10:07

mine one thing to draw your attention to

play10:10

is when i created an index.html file

play10:13

i have the little icon for html5 beside

play10:16

it you may not have that but if we click

play10:18

on extensions and then we can delete

play10:21

prettier that i searched for before

play10:24

type vs code dash icons

play10:27

there you'll find the extension that

play10:28

will add that to your vs code as well so

play10:31

you can install i already have it

play10:33

installed so mine says uninstall and

play10:36

that will add icons as you create files

play10:39

and it might add the icon up here as

play10:41

well in the tab and that's how you see

play10:44

the icon here beside my index.html in

play10:47

the file explorer so visually it helps

play10:49

you see what type of file you're working

play10:51

with quickly without even reading

play10:53

everything after that extension let's go

play10:56

ahead and click the extensions icon

play10:58

again

play10:59

and then search for

play11:02

github

play11:03

theme i am using a specific theme

play11:06

which i prefer dark mode in every thing

play11:09

that i do so i am using the github theme

play11:13

extension and it has light and dark

play11:15

themes i believe i'm using the default

play11:18

dark theme this might be bright for a

play11:20

second but i'll click set color theme

play11:22

and yes it's switched back to light but

play11:24

i choose github dark default

play11:27

and then yours will look much like mine

play11:30

now these previous extensions have been

play11:32

optional but one that i say is a must

play11:35

for you to install is called live

play11:38

server so let's pull up live server by

play11:40

ritwick day i'll click on that and you

play11:43

want to install live server because it's

play11:45

going to help us view our web pages so

play11:48

go ahead and install live server and

play11:51

after you have it installed we'll go

play11:53

ahead and take a look at the web page

play11:55

we've created

play11:56

okay with that installed i'm going to

play11:58

close that tab i'll come back to the

play12:00

file explorer here to show the file and

play12:03

now if you have live server installed

play12:05

you should be able to right click and

play12:08

open with live server and once we choose

play12:11

open with live server it opens our

play12:13

browser and we can see our web page it

play12:16

says hello world this is my first web

play12:18

page

play12:19

in addition in the tab at the top it

play12:22

says

play12:23

my first web page so that is where the

play12:26

title goes at the very top of the

play12:28

browser in the tab now this is very

play12:31

bright and i have mentioned that i

play12:32

prefer dark mode so let's go back to

play12:35

visual studio code and i'm just going to

play12:37

paste in some quick styling that is

play12:40

actually css once again this is optional

play12:43

but it will save my eyes and possibly

play12:45

yours as we work through this tutorial

play12:48

so once we're back in visual studio code

play12:51

just underneath the title in the head

play12:54

section i'm going to paste this in i'll

play12:57

quickly describe it i put in a style

play13:00

element and that allows me to put in

play13:02

some quick css

play13:04

and i changed the font size to make it

play13:07

just a little larger

play13:08

and then i changed the background color

play13:11

to a dark color and i changed the font

play13:14

color to an off-white color called white

play13:17

smoke and that's all i did we're not

play13:19

really learning css here but this will

play13:22

save our eyes going forward if you want

play13:24

to make these changes if you prefer the

play13:26

white with dark text that is fine too

play13:28

but now that i've saved this the beauty

play13:30

of live server is that it automatically

play13:33

reloads our page for us in the browser

play13:36

so let's go back to the browser and look

play13:38

at our update and now you can see our

play13:40

web page is in dark mode and we have a

play13:44

little bit larger text here as well it

play13:46

did not change our title from the head

play13:48

because that just goes into the tab of

play13:51

the browser also notice the address this

play13:55

is an ip address and then we have a

play13:57

colon and this is a port number but this

play14:00

is on your own computer this is not on

play14:02

mine i can't go onto the web and see

play14:05

your page that we just created we

play14:06

haven't loaded it to the web it is just

play14:08

running on your computer but this is the

play14:11

way to view web pages as we create them

play14:13

which creates your own local server it's

play14:16

what's called a dev environment and that

play14:18

is preferred what you don't want to do

play14:21

in chrome is try to open a file like you

play14:24

would in word or some other document

play14:27

browser or even visual studio code how

play14:29

we open files that's not how you want to

play14:31

view a web page you want to use a

play14:33

development server and that's what we're

play14:35

doing with live server in visual studio

play14:38

code now if you ever want to stop the

play14:40

server down here in the bottom you can

play14:42

see the port number 5500 and it says

play14:45

click to close server so i can just

play14:47

click that it says disposing and now we

play14:50

have a go live button which you can also

play14:52

use you can also right click on your

play14:54

document and choose stop or open with

play14:57

live server now we would once again

play15:00

since we stopped that we would need to

play15:02

open with live server to have a live web

play15:05

page that responds to changes we make

play15:07

and notice how it opened a new tab here

play15:09

instead of our old tab our old tab the

play15:12

server for that page closed so we close

play15:15

that out and now we're using this one

play15:17

because this is going to show our most

play15:19

recent changes now after we've created a

play15:22

web page how do we know if we have

play15:24

errors or not well that's where a

play15:26

validation service comes into play and

play15:29

this is the w3c markup validation

play15:33

service

play15:34

w3c stands for the world wide web

play15:37

consortium that really makes the

play15:39

standards for the web overall what we

play15:42

want to do to check our page is click

play15:44

file upload because remember our web

play15:47

page is really not on the web it's just

play15:49

on our computer your web page is on your

play15:52

computer and mine is on my computer so

play15:54

let's click file upload

play15:56

and from here we're going to choose the

play15:58

file on the computer

play16:00

and we get a browse window and now i'm

play16:03

going to click

play16:05

html tutorials

play16:07

and then i have an html course folder

play16:10

and then the xero lesson one folder that

play16:13

we just created

play16:14

and there is the index.html file we've

play16:17

been working with so i'll click open

play16:19

and now that it's here we can click

play16:22

check

play16:22

and we're going to get some errors and

play16:25

we'll go over those

play16:28

okay now that we have checked our page

play16:31

we have got a warning and a couple of

play16:33

errors so there are things we need to

play16:35

fix

play16:36

in our html file let's address these in

play16:39

order with the first warning says

play16:41

consider adding a lang attribute to the

play16:44

html start tag to declare the language

play16:47

of the document so that is something we

play16:49

should do

play16:52

now we're going to go to the html tag

play16:55

and we can add what is called an

play16:56

attribute and this is the lang attribute

play16:59

and i'm going to set it equal to en

play17:02

which is the abbreviation for english in

play17:04

general

play17:06

you can supply a dialect like this dash

play17:09

us

play17:10

or i believe the other would be gb

play17:14

but i don't usually do that so i'm just

play17:16

putting e in for english

play17:18

you might have another language you

play17:20

prefer to put there and you can find a

play17:22

list of those at the mdn network as well

play17:25

and that's the page where we were

play17:27

looking for the definition of html at

play17:30

the beginning of this tutorial so i will

play17:32

link to mdn the mozilla developer

play17:35

network in the description now that

play17:37

we've added the language attribute let's

play17:40

go look at the other errors we had and

play17:42

see what else we need to fix

play17:44

it says the character encoding was not

play17:47

declared so we also need to handle that

play17:50

let's go back to visual studio code

play17:54

and now inside the head

play17:56

there is an element called meta earlier

play17:59

i said the head stores metadata let me

play18:02

keep it all lower case here and here we

play18:05

can set what is called the character set

play18:08

attribute inside of a meta element

play18:11

and from here i'll put

play18:14

utf-8 which is the standard for all web

play18:17

pages that i have worked on there are

play18:19

other character sets but this is the

play18:21

typical

play18:22

value you would see in there so i'm

play18:24

going to save this

play18:26

and in the future we'll cover more meta

play18:29

tag values that we'll have inside of the

play18:32

head now let's go back and look at that

play18:33

last error that we got from the

play18:35

validation service and that said start

play18:38

tags seen without seeing a doctype first

play18:41

expected and it shows you exactly what

play18:43

it wants doctype

play18:45

html and that is a document type

play18:49

declaration that should be on the very

play18:52

first line of your page so let's go back

play18:55

to our html file

play18:57

go to the very top

play18:59

and we'll press return

play19:01

and we'll paste in exactly what they had

play19:04

there so you see once again it starts

play19:06

with the less than and the greater than

play19:08

symbol but this is not really an html

play19:10

element or tag this is just a doctype

play19:14

declaration that you should have in

play19:17

every html file at the very beginning so

play19:20

now i'll put that in and save as well

play19:23

let's look at

play19:25

the validator first and let's choose the

play19:28

file again

play19:32

and now i've selected the index.html to

play19:34

upload with our changes and we'll click

play19:36

check

play19:38

document checking completed no errors or

play19:41

warnings so our document is just fine

play19:43

let's go to the tab with our page

play19:46

and let's reload the page

play19:48

and once we reloaded everything looked

play19:51

great so we've got hello world this is

play19:53

my first web page and we still have my

play19:55

first web page in the tab at the top for

play19:58

the title

play19:59

and we have passed all validation checks

play20:02

remember to keep striving for progress

play20:04

over perfection and a little progress

play20:06

every day will go a very long way please

play20:09

give this video a like if it's helped

play20:11

you and thank you for watching and

play20:13

subscribing you're helping my channel

play20:15

grow have a great day and let's write

play20:17

more code together very soon

Rate This
β˜…
β˜…
β˜…
β˜…
β˜…

5.0 / 5 (0 votes)

Related Tags
WebDevelopmentHTMLTutorialBeginnerGuideDaveInstructorGoogleChromeVisualStudioCodeDarkModeLiveServerW3CValidationCodeFormatting