HTML and CSS for Beginners Part 2: Building your first web page!

Kevin Powell
26 Oct 201614:28

Summary

TLDRThis video serves as an introduction to HTML and CSS for beginners in web development. The host guides viewers through setting up a code editor, creating a new folder for their website, and writing basic HTML structure including the doctype, head, and body tags. The importance of the index.html file as the homepage is highlighted, along with adding a title and meta tag for browser compatibility. The video concludes by encouraging viewers to use the basic template for new projects and promises more content in upcoming videos.

Takeaways

  • πŸ˜€ This is the second video in a series introducing HTML and CSS for beginners in web development.
  • πŸ” Viewers are encouraged to watch the first video for foundational knowledge before proceeding.
  • πŸ“ The video focuses on writing HTML and emphasizes the importance of understanding the material rather than just following along.
  • πŸ› οΈ Several free code editors are mentioned, including Atom, Notepad++, and Brackets, with Atom being the one used in the demo.
  • πŸ“ The process of creating a new folder on the desktop to house the website files is demonstrated, establishing the root directory.
  • πŸ“‚ Opening the new folder in a code editor is shown, highlighting the use of keyboard shortcuts for efficiency.
  • πŸ“„ The creation of an 'index.html' file is detailed, explaining that it is the default homepage for a website.
  • 🌐 The 'doctype' declaration is discussed as a crucial line of code that informs the browser the file is HTML.
  • πŸ“– The structure of an HTML document is explained, including the 'head' for metadata and the 'body' for visible content.
  • 🏷️ The use of 'title' and 'meta' tags within the 'head' section is covered, explaining their roles in the browser and search engine results.
  • ✍️ The video concludes with the addition of visible content within the 'body' tag and the suggestion to use the basic HTML structure as a template for new projects.

Q & A

  • What is the purpose of the second video in the introduction to HTML and CSS series?

    -The purpose of the second video is to begin writing actual HTML code and to guide viewers through the initial steps of web development using HTML.

  • Why should viewers check out the first video if they haven't seen it?

    -Viewers should watch the first video to understand how HTML works and to have a foundation before starting to write HTML code, ensuring they don't just follow along blindly without understanding the basics.

  • What are some free software options mentioned for writing code in the video?

    -The video mentions Atom, Notepad, Notepad++, and Brackets as free software options for writing code.

  • Why is it important to create a new folder for a website?

    -Creating a new folder is the first step in building a website, serving as the root directory where all the website's files and resources will be stored.

  • How does one open a folder in a code editor like Atom or Brackets?

    -You right-click the folder, and if using Atom or Brackets, you can select 'Open with Atom' or 'Open with Brackets' to open the folder in the respective code editor.

  • What is the significance of the 'index.html' file in a website?

    -The 'index.html' file is significant because it is the default file that servers look for as the home page of a website. It must be named exactly 'index.html' with lowercase letters.

  • Why is the 'doctype' declaration important in an HTML file?

    -The 'doctype' declaration is important because it tells the browser that the file is an HTML document and helps the browser to render the page in standards mode.

  • What is the purpose of the 'head' section in an HTML document?

    -The 'head' section contains metadata about the document, such as the title and character set, which does not display on the page itself but is essential for the browser and search engines.

  • What is the 'meta' tag used for in the 'head' section of an HTML document?

    -The 'meta' tag is used to provide metadata about the HTML document, such as character encoding (e.g., 'charset=UTF-8'), which helps the browser to correctly display the content.

  • How does the speaker suggest organizing the workspace while coding and viewing the results in a browser?

    -The speaker suggests having the code editor on one side and the browser on the other, allowing for easy viewing and updating of the code and its results simultaneously.

  • What is a recommended practice for saving time when coding and refreshing the browser to see changes?

    -The recommended practice is to use keyboard shortcuts for saving, such as 'Ctrl + S' or 'Command + S' on a Mac, and then refreshing the browser to quickly see the changes.

  • Why might a beginner save the basic HTML structure as a template for future projects?

    -Saving the basic HTML structure as a template can save time and effort for beginners, as it provides a starting point for new projects without having to rewrite the fundamental code each time.

Outlines

00:00

πŸ“ Introduction to HTML and CSS

This paragraph introduces the video as the second in a series on HTML and CSS for beginners in web development. The speaker encourages viewers to watch the first video and mentions that today's focus is on writing HTML code. It provides a brief overview of HTML tags and emphasizes the importance of learning a few essential ones. The speaker also suggests using a code editor like Atom, Notepad++, or Brackets and provides links in the description for downloading these tools. The video script includes instructions on creating a new folder for the website and opening it in the chosen code editor.

05:08

πŸ’» Setting Up the Code Environment

The speaker explains the initial steps for setting up a code environment, including creating a new folder for the website files and opening it in a code editor. They guide the viewer through the process of creating a new file and saving it with the '.html' extension, which is crucial for the file to be recognized as an HTML document. The paragraph also discusses the importance of the 'doctype' declaration, which informs the browser that the file is an HTML document. Additionally, it touches on the structure of an HTML document, including the 'head' and 'body' sections, and the significance of the 'title' tag within the 'head'.

10:08

🌐 Writing Basic HTML Structure

This paragraph delves into the actual writing of HTML code, starting with the basic structure that includes the 'doctype', 'html', 'head', and 'body' tags. The speaker explains the redundancy of stating the document type and the beginning and end of the HTML section, emphasizing the importance of following this structure for browser compatibility. It also introduces the 'meta' tag, specifically the 'charset' attribute set to 'utf-8', which tells the browser the character encoding being used. The paragraph concludes with a suggestion to use the basic HTML structure as a template for future projects, streamlining the process of starting new web development tasks.

Mindmap

Keywords

πŸ’‘HTML

HTML, or HyperText Markup Language, is the standard markup language used to create web pages. It is composed of a series of elements, which are the building blocks of all web pages. In the video, HTML is the central focus, as the creator is teaching viewers how to write HTML code to structure a webpage, starting with the basic document setup.

πŸ’‘CSS

CSS stands for Cascading Style Sheets, which is a language used to describe the presentation of a document written in HTML. While not the main focus of this particular video, CSS is mentioned as part of the introduction to web development, implying that it will be covered alongside HTML for styling web pages.

πŸ’‘Web Development

Web development is the building and maintaining of websites; it includes aspects such as web design, web content creation, and coding. The video is an introduction to this field, specifically focusing on HTML and CSS as foundational skills for anyone new to web development.

πŸ’‘Code Editor

A code editor is a type of text editor specifically designed for editing source code with various features for programmers. In the script, the creator mentions using a code editor called 'Atom' to write HTML code, emphasizing the importance of having the right software for coding.

πŸ’‘Root Directory

The root directory is the top-level directory in a file system, which contains all other folders and files. In the context of the video, the creator creates a new folder on the desktop as the root directory for the website files, indicating where all the website's content will be stored.

πŸ’‘Index.html

The index.html file is traditionally the entry point for websites, often used as the homepage. The video explains that naming a file 'index.html' signifies that it should be the main page served by web servers when someone visits the site's domain.

πŸ’‘DOCTYPE

The DOCTYPE is a declaration in HTML that indicates which version of HTML the document is written in. In the video, the creator includes the DOCTYPE declaration at the beginning of the HTML document to inform the browser that the page is written in HTML5.

πŸ’‘Head and Body

In HTML, the 'head' element contains meta-information about the document, while the 'body' element contains the content that is displayed on the web page. The video script describes how to structure these elements within an HTML document, with the 'head' for metadata and the 'body' for visible content.

πŸ’‘Title Tag

The 'title' tag in HTML defines the title of the document, which is displayed in the browser's title bar or tab. The video demonstrates how to use the 'title' tag within the 'head' section to set the title of the webpage, which is also used in search engine results.

πŸ’‘Meta Tag

A 'meta' tag provides metadata about an HTML document, which cannot be seen by users but can be read by browsers and search engines. The video specifically mentions the 'charset' meta tag, which is used to specify the character encoding for the document, in this case, UTF-8.

πŸ’‘Indentation

Indentation in coding refers to the arrangement of lines of code to create a visual hierarchy, making the code easier to read and understand. The video mentions using indentation to visually indicate that certain lines of code are nested within others, such as content within the 'head' or 'body' tags.

Highlights

Introduction to the second video in a series about HTML and CSS for beginners in web development.

Encouragement to check out the first video for foundational knowledge.

Explanation that while there are many HTML tags, only a few are essential for beginners.

Advice to pause or rewind videos for better understanding instead of just following along.

Recommendation of free code editors like Atom, Notepad++, and Brackets for writing code.

Demonstration of creating a new folder on the desktop as the root directory for a website.

Instruction on how to open a new folder in a code editor like Atom or Brackets.

Explanation of how to create a new file in a code editor and the importance of naming it 'index.html'.

Clarification on the function of 'index.html' as the default homepage for any website.

Description of how to set up a dual-screen workspace with a code editor and a browser.

Introduction of the '<!DOCTYPE html>' declaration to inform the browser about the HTML file type.

Explanation of the structure of an HTML document including 'head' and 'body' tags.

Importance of the 'head' section for metadata and the 'body' for visible content.

Demonstration of adding a 'title' tag within the 'head' to define the page's title.

Usage of the 'meta' tag to specify the character set as UTF-8 for the browser.

Discussion on the benefits of using indentation to improve code readability.

First steps in adding visible content to the 'body' of the HTML document.

Tip on saving a basic HTML structure as a template for future projects.

Anticipation for future videos that will delve into adding more content and styling.

Invitation for viewers to ask questions in the comments for further clarification.

Encouragement to subscribe for upcoming tutorials on more advanced web development topics.

Transcripts

play00:00

hey YouTube really glad you could join

play00:02

me today you found the second video in

play00:04

my introduction to HTML and CSS if

play00:06

you're just getting your feet wet within

play00:08

the fabulous world of web development

play00:10

well you found the right place and I

play00:12

encourage you to go check out the first

play00:13

video if you didn't see that one today

play00:15

we're actually gonna be writing some

play00:17

HTML so well what are we waiting for

play00:19

let's get started in the last video we

play00:25

looked at how HTML works the only thing

play00:28

is as much as I'd love people to make up

play00:30

my own tags like I did in that last

play00:32

video we just can't do that there are

play00:34

lots of tags out there but luckily there

play00:36

are only a few of them that you'll need

play00:38

to know to really get started as a quick

play00:40

side note don't be shy about pausing or

play00:42

even rewinding the videos you go do this

play00:44

at your own pace and make sure you

play00:45

understand as you go along instead of

play00:47

just blindly following and having no

play00:49

idea what you're really doing and if I

play00:52

can fuse you with anything let me know

play00:53

in the comments and I'll do my best to

play00:55

clarify before we can get started we

play00:57

need some software to write our code in

play00:59

there are lots of free options out there

play01:01

and the one I mean to be using for my

play01:03

demos is called Adam which I have on my

play01:06

screen right now it's completely free

play01:08

there are other free ones out there that

play01:10

are really popular like notepad we can

play01:12

see right here notepad plus plus I

play01:15

should say as well as brackets which you

play01:18

can see right here so if you don't have

play01:20

a code edit or pause the video follow

play01:22

one of the links I'm gonna put links in

play01:23

the description below and download one

play01:25

of them and join me back here once

play01:27

you're ready to go

play01:28

so you've installed your code editor but

play01:31

what do we do with it well the very

play01:34

first step to building a website is to

play01:36

create a place for it to live so I'm

play01:38

gonna go and make a new folder on my

play01:40

desktop so I'm just gonna right click

play01:41

new folder and my first website and

play01:48

there we go I got a nice little folder

play01:51

there and this is where my websites

play01:54

going to live it's the root directory

play01:56

anything that I need for my site is

play01:58

going to be in there now I want to open

play02:00

this up in my code editor so I'm going

play02:02

to right click and if you're using atom

play02:04

or brackets I have both of them right

play02:06

there I can just click on open with atom

play02:09

and we wait for the program to open

play02:13

and there we go so I opened up my folder

play02:15

let's just bring it on the screen so you

play02:16

guys can see it a little bigger there we

play02:21

go great so I've got it open but there's

play02:26

nothing here so we actually need to go

play02:29

ahead and start working now one thing if

play02:33

you are using like Adam like I am it's

play02:35

possible you don't have anything along

play02:37

the top here so if you want to get to

play02:40

any of them if you just have to push alt

play02:41

the Alt key on the keyboard brings up

play02:44

this little menu so to make your first

play02:46

file we just go to file and file new or

play02:50

you can use them either if you're on a

play02:51

Mac command N or on a PC ctrl n to make

play02:56

your new file and I have a nice little

play03:00

untitled file here now one thing you

play03:03

have to know is code editors they can

play03:04

get with lots of different types of

play03:06

files just like with Microsoft Word you

play03:08

can save a doc file the new docx files

play03:11

PDFs and some other stuff from there as

play03:13

well RTF s-- and whatnot and it's a

play03:16

little bit of the same deal here except

play03:18

there's no default they don't it's not

play03:20

like word where the default is a doc and

play03:22

then there's all these other options in

play03:23

this case there's no default there's a

play03:26

whole bunch of different things from

play03:27

HTML CSS JavaScript PHP asp.net it just

play03:34

goes on and on and on really so we need

play03:36

to tell it what type of file this is

play03:38

going to be and the best way to do that

play03:40

are the only really way is to save our

play03:42

file so I'm gonna come down to here and

play03:44

hit save and it's going to ask me how I

play03:47

want to save my file and I'm gonna call

play03:50

it index dot HTML and I have to write

play03:54

the HTML out it's not like those other

play03:56

ones as I just mentioned there's no

play03:58

default so I'm gonna write out dot HTML

play04:01

and I'm gonna push save and we can get

play04:04

going um

play04:06

now there's annum there's a reason I'm

play04:07

calling it index.html and it has to do

play04:10

with house servers work and my index is

play04:12

with a lowercase I we're always just

play04:14

going to be using lowercase stuff and

play04:16

just for now know that whatever you want

play04:19

your home page to be that has to be your

play04:21

index.html we don't use home page

play04:24

EML or home dot html' or anything else

play04:26

the the home page of your site is your

play04:30

index dot HTML so we've got our HTML

play04:33

file but well what do we need to do now

play04:35

a good thing to do is actually to open

play04:37

up your page so I'm gonna minimize this

play04:39

for one second

play04:40

I'm gonna find my folder and I'm going

play04:42

to open up my index.html and let's just

play04:47

bring that onto the screen so you can

play04:49

see it and it's a nice blank document

play04:53

right now so let's fix that up a little

play04:55

bit and this is usually how I like to

play04:58

work

play04:59

let's open atom backup okay there we go

play05:08

so basically what I want is I want my

play05:09

code editor on the side here and I want

play05:11

my browser over here so I can see the

play05:13

two of them at the same time while I

play05:14

work so as I can save here and then I

play05:19

can update this and see what I'm

play05:21

actually doing in general the way I work

play05:24

is I always have my code editor on the

play05:26

left and my browser on the right just

play05:28

because that's how I'm used to working

play05:30

but you can set this up however you want

play05:32

some people put one on top one on the

play05:34

bottom or you know this could be but it

play05:36

doesn't it doesn't matter how you set it

play05:37

up but I like having always everything

play05:40

set up just so I can see both of them

play05:42

really easily and now the real fun

play05:45

begins we need to start writing some

play05:48

HTML so if you remember everything in

play05:51

HTML all the code goes inside of

play05:54

triangle brackets let's give me an ER

play05:56

because I have nothing in there and the

play05:57

first thing we need to do is put in this

play06:00

line of code I have to say doctype HTML

play06:05

so just like my code editor can create a

play06:08

whole bunch of different types of files

play06:10

my the browser can read lots of

play06:13

different files it can be a CSS file

play06:15

javascript file or an HTML file PHP file

play06:20

there's a whole bunch so this is a

play06:22

really important line it always goes

play06:25

right at the top and it's telling the

play06:28

browser that it's looking at an HTML

play06:30

file this is sort of the standard way of

play06:33

writing it where this is always in

play06:35

capitals so it's exclamation

play06:37

mark let's make that a little bigger so

play06:41

we have our exclamation mark doctype and

play06:43

then the HTML and it's all inside of my

play06:46

triangle brackets now this part can seem

play06:50

a little bit redundant but what I'm

play06:52

gonna do now is I'm gonna come down and

play06:54

I'm going to put HTML and what we want

play07:00

to do next is we need to close our HTML

play07:04

so I'm open triangle bracket I'm writing

play07:08

out HTML closing triangle bracket and

play07:11

then down here at the bottom the same

play07:13

thing but with my forward slash just

play07:15

like we looked at the last video so this

play07:18

is seems a bit silly we're telling our

play07:20

document our browser that we're looking

play07:23

at an HTML file and then we're coming

play07:25

here and we're telling it that starting

play07:28

here will be each tml and the HTML ends

play07:31

here but as redundant as it seems we do

play07:35

have to do it and one thing you'll

play07:36

notice is everything I put in my tags is

play07:38

lower case except for this doctype in

play07:41

general everything in the tags lower

play07:43

case and you'll be good to go so a few

play07:46

other new tags that we're gonna look at

play07:48

every website has two parts to it

play07:51

it has what we called a head close head

play07:55

and the body close body

play08:00

now let me space this out a little bit

play08:02

and I'll put more space there I would

play08:06

normally put all this space but I just

play08:08

want to make it a bit easier for you

play08:09

guys to see so here I'm opening my head

play08:12

and I'm closing my head and here I'm

play08:14

opening my body and I'm closing my body

play08:17

the head is where the extra information

play08:19

goes this stuff doesn't show up on the

play08:21

screen but it's essential to getting

play08:23

things to work properly plus we can add

play08:25

a little bit of extra info in there too

play08:27

and the body this is where all the

play08:29

content goes anything we want the person

play08:32

to see on their screen in their browser

play08:33

here that has to go inside the body

play08:35

right here and well maybe it'll be a

play08:38

little bit boring I'm actually gonna

play08:40

start by doing a few little things up

play08:42

here in the head first so I'm gonna come

play08:45

in the head and I'm going to write title

play08:47

and

play08:48

my first web site and I'm gonna close

play08:52

title so I'm gonna save my file and then

play08:57

I have to come over to my browser and

play08:58

I'm gonna hit this little refresh and

play09:00

I'm about to push it but what I want you

play09:02

to do right now if you see this tab here

play09:04

it just says index.html and when i

play09:07

refresh now it says my first website so

play09:10

the title isn't something that shows up

play09:12

on my page because it's inside the head

play09:15

it's extra information and it's being

play09:17

used for the tab up here another place

play09:20

where the title will be used is if

play09:21

someone does a google search for your

play09:22

website it's the title that shows up in

play09:25

the google search it's not actually

play09:27

content from your site that will be

play09:28

there so there's one other little thing

play09:30

that I'm gonna add in the head here

play09:32

which is called meta tag so anyone who's

play09:36

done a little bit of photography

play09:38

probably knows what the meta or what

play09:41

meta information is and it's sort of

play09:43

extra information in photography when

play09:45

you take a picture with the digital

play09:47

camera it's gonna save the ISO it's

play09:49

going to save the shutter speed probably

play09:51

even the location and time and date and

play09:54

all those things so all that information

play09:56

is saved with the photo but if you look

play09:58

at the photo you don't see it you have

play09:59

to use some software to you know get

play10:01

that extra information so a meta tag

play10:04

like this is a little bit the same

play10:06

there's a lot of different ones but the

play10:08

only one that's essential is the car set

play10:12

UTF and you can see this is actually

play10:14

Auto filling for me so I'm going to go

play10:17

right there and double click on it and

play10:18

get my car set utf-8 and this seems a

play10:23

little strange basically we're just

play10:25

telling the browser what character set

play10:30

we're using it's all about the

play10:32

characters that are embedded so all

play10:33

these letters that are on the screen the

play10:35

computer doesn't really know it and F is

play10:37

it's using this encoding system and

play10:40

utf-8 is sort of the standard for most

play10:43

languages these days and it just saves

play10:46

all the characters that we'd ever want

play10:48

to put on the screen and we have to tell

play10:49

the browser that this is what we're

play10:51

going to be using the other thing you'll

play10:53

notice here and most of these code

play10:56

editors do this by default but my head

play10:59

is here and it's closing here

play11:00

click there it's even underlining it to

play11:02

make it more obvious and then this is

play11:05

indented and this indentation is just to

play11:08

make it more visually obvious that this

play11:10

stuff is inside there so I could write

play11:12

it like this it wouldn't make any

play11:14

difference to the browser but by having

play11:17

it spaced out and you can either do that

play11:19

with the tab key and I'll come here and

play11:21

I'll push tab and it creates just that

play11:23

space other people like using the

play11:25

spacebar I'll put two or some people put

play11:28

four spaces and it's just to make a nice

play11:32

visual representation that this stuff is

play11:35

inside my head and you can even do the

play11:37

same thing here with your title if you

play11:38

wanted to so I have open title this is

play11:42

inside my title tag and then close title

play11:44

but I think it's just a little easier to

play11:47

read for a nice little short thing like

play11:49

that just to put it like that for my

play11:51

title now we can finally put some stuff

play11:54

on our page we can actually see some

play11:56

things showing up here so let's just

play11:59

jump right into our body tag and I'm

play12:02

gonna push tab because I'm inside my

play12:04

body tag and right let's just you know

play12:06

my first website I'm gonna push save

play12:10

refresh and look at that I have some

play12:14

content on my page I've just noticed

play12:17

what I'm saving most of the time here

play12:18

I've been pushing ctrl s or if you're on

play12:21

a Mac that would be command S which is

play12:24

you know file and just save I'm so I'm

play12:27

whenever you see me doing this I'm just

play12:29

ctrl essing and then refreshing it's

play12:31

much faster for me than having to jump

play12:34

up here every time so I've been doing

play12:36

that just in case you're wondering why

play12:38

you don't see me saving the file and I

play12:41

can still get it to work so we don't

play12:43

really have much content on our page

play12:45

right now but hey it took us a lot of

play12:47

work just to get to this point so give

play12:49

yourself the knife pat on the back for

play12:51

making it this far and in the next video

play12:53

we're gonna start looking at really

play12:54

putting some content in here because

play12:56

this this little line of text isn't very

play12:57

much so we're gonna start exploring

play12:59

paragraphs and headings and getting some

play13:02

some content on there that looks a

play13:04

little bit better but be happy with what

play13:06

you have in a little pro tip I'm gonna

play13:09

clean this up a little bit let's just

play13:10

take out some of this extra space that I

play13:12

don't need

play13:13

and I don't really need this line and

play13:16

you could you know every single page

play13:19

you're gonna make is always gonna start

play13:21

with this is the very basic so you could

play13:23

save this document just like that and

play13:25

use it as a bit of a template file for

play13:27

every time you're starting up a new

play13:29

project it's a nice starting point

play13:30

especially when you're starting off this

play13:32

is all you're really going to need for

play13:33

your first few little things so you

play13:36

might as well save it and just keep this

play13:38

as a little template that you can reuse

play13:39

every time so you don't necessarily have

play13:42

to rewrite all of this each and every

play13:45

time so I really hope you learned

play13:46

something watching this I hope that it

play13:48

made sense and I hope that it's nice and

play13:50

clear and that you've been able to

play13:52

follow along if it wasn't clear if you

play13:55

have any questions whatsoever

play13:56

hit me up down in the comments below I

play13:58

definitely will get back to you and keep

play14:01

on watching we're gonna get on and be

play14:03

doing a lot of really cool stuff it

play14:05

starts off really slow we have a white

play14:07

page some black text on there but really

play14:09

really soon you're gonna be doing

play14:10

something really awesome so keep

play14:12

following along subscribe to the channel

play14:14

so you don't miss any of the videos that

play14:15

are coming up and have yourselves a

play14:18

great day

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

5.0 / 5 (0 votes)

Related Tags
Web DevelopmentHTML TutorialCSS BasicsBeginner GuideCode EditorWebsite BuildingHTML StructureWeb DesignOnline LearningDeveloper Tools