text stringlengths 1 81 | start float64 0 10.1k | duration float64 0 24.9 |
|---|---|---|
And that's the information
that's going to be displayed | 530.84 | 2.3 |
when someone visits this web page. | 533.14 | 2.38 |
And so that's all there
really is to this HTML page. | 535.52 | 2.65 |
We specified in the header that there's
a title of the page called hello. | 538.17 | 3.61 |
And inside the body, we're saying the
page should say the words hello world. | 541.78 | 4.54 |
And if you want to visually
think about the way | 546.32 | 2.3 |
that all these HTML
elements are structured, | 548.62 | 2.46 |
it can sometimes be helpful
to think about an HTML page | 551.08 | 2.88 |
in terms of a tree-like
structure that we | 553.96 | 2.28 |
call the document object model, or DOM. | 556.24 | 3.12 |
And so, here, for example, is
what the DOM for this web page | 559.36 | 3.69 |
might actually look like. | 563.05 | 1.29 |
Here on the left is the HTML content
that we just saw a moment ago. | 564.34 | 3.39 |
And over here on the right is the
DOM, the document object model, | 567.73 | 3.84 |
the tree-like structure that describes
how all of these HTML elements | 571.57 | 4.32 |
are related to each other. | 575.89 | 1.6 |
So we start up here
with the HTML element. | 577.49 | 2.48 |
And this parent element, so to
speak, has two child elements | 579.97 | 4.05 |
within it, a head element
and a body element. | 584.02 | 3.06 |
As we can see here,
we're inside of HTML. | 587.08 | 2.64 |
We have a head section
and a body section. | 589.72 | 2.43 |
And the indentation here that
we're including in the HTML text, | 592.15 | 3.54 |
it's not strictly necessary. | 595.69 | 1.53 |
The web browser doesn't care
what the indentation is. | 597.22 | 2.64 |
But it can be helpful for someone
who's reading the page just | 599.86 | 2.82 |
to see the indentation to understand
visually that the head is inside | 602.68 | 3.9 |
of the HTML element and the body
is inside of the HTML element too. | 606.58 | 4.86 |
So inside of the head element,
we have a title element. | 611.44 | 2.58 |
And inside of the title element
is just the text, the word hello. | 614.02 | 3.78 |
And likewise, inside
of the body element, | 617.8 | 2.14 |
we also have some text,
the text hello world. | 619.94 | 3.11 |
So thinking about HTML and HTML
documents in terms of this structure | 623.05 | 4.26 |
can be helpful for understanding which
HTML elements are inside of which | 627.31 | 4.05 |
other HTML elements. | 631.36 | 1.53 |
And that's going to make it easier
for us to reason about these pages | 632.89 | 3 |
later on. | 635.89 | 0.81 |
And especially as we later transition
into the world of JavaScript, | 636.7 | 3.27 |
JavaScript is going to make
it all the more powerful | 639.97 | 2.37 |
and give us the ability to actually
modify parts of this DOM as well. | 642.34 | 3.78 |
But we'll certainly get
to that in due time. | 646.12 | 2.92 |
So now, let's take a look at some of
the other common HTML tags and HTML | 649.04 | 4.28 |
elements that we might be
interacting with in our web page. | 653.32 | 3.33 |
And we'll start by thinking about
HTML headings, so big banners | 656.65 | 3.81 |
at the top of the page, for
example, some headline that | 660.46 | 2.34 |
describes what a page is about. | 662.8 | 2.5 |
So I'll go ahead into my text
editor and create a new file | 665.3 | 3.05 |
that I'll call headings.html. | 668.35 | 3.19 |
And the structure of this page is
going to be pretty similar to the pages | 671.54 | 3.05 |
that we've seen before already. | 674.59 | 1.63 |
So I'm going to start by just using the
hello.html text and paste it in here. | 676.22 | 5.17 |
I'll change the title of the page. | 681.39 | 1.42 |
Instead of hello, we'll go
ahead and call it headings. | 682.81 | 3.79 |
But inside the body of this page now, I
want something a little bit different. | 686.6 | 4.55 |
I'm going to, inside the body
the page, use an h1 element | 691.15 | 3.8 |
and say this is a heading, for example. | 694.95 | 5.2 |
So h1 is a tag that I can use to create
a large heading at the top of my page, | 700.15 | 4.55 |
like for the title of
the page, for example. | 704.7 | 2.89 |
So if I open up headings.html. | 707.59 | 3.62 |
I might see something
that looks like this, | 711.21 | 2.51 |
a big heading at the top of my
page that says, this is a heading. | 713.72 | 3.61 |
h1, where the h stands for heading
and the 1 stands for the largest | 717.33 | 4.23 |
possible heading. | 721.56 | 0.96 |
And in fact, HTML gives us
a number of different tags | 722.52 | 2.67 |
that we can use in order to
create headings of various sizes. | 725.19 | 3.78 |
So, for example, I could also
say h2 inside of which I say, | 728.97 | 4.92 |
this is a smaller heading. | 733.89 | 2.74 |
If h1 is the largest heading, h2
is the second largest heading. | 736.63 | 4.31 |
So if I load this page, for example,
I now see the h1 at the very top. | 740.94 | 3.78 |
This is the big heading. | 744.72 | 1.47 |
And then beneath that, I see this
is a smaller heading, the h2. | 746.19 | 3.96 |
And it turns out there's
also h3, h4, h5, all the way | 750.15 | 3.33 |
down to h6, which is
the smallest heading, | 753.48 | 4.54 |
such that if I load this page now,
I have a big heading, a smaller one, | 758.02 | 3.74 |
and then here's the smallest. | 761.76 | 1.5 |
So we can often use
these h1, h2, h3 tags | 763.26 | 3.36 |
just for visually organizing
text inside of a page. | 766.62 | 2.61 |
If I want the title of
the page, but also I | 769.23 | 3.12 |
want titles for each of the various
different sections and subsections | 772.35 | 3.78 |
that might be contained
within that page as well. | 776.13 | 4.21 |
So those are headings. | 780.34 | 1.04 |
And now, let's also take a
look at some other elements | 781.38 | 1.98 |
that we might want to add. | 783.36 | 1.08 |
On web pages, we see not just
titles and not just text, | 784.44 | 2.79 |
but we might also see
lists, for example. | 787.23 | 2.31 |
Like if you've ever used a to
do list program on a web page, | 789.54 | 2.8 |
for example, you might see a list
of things that you need to do | 792.34 | 2.63 |
or other web pages might
display lists of information. | 794.97 | 3.3 |
And it turns out that HTML
has two basic types of lists. | 798.27 | 3.72 |
We have ordered lists for things
that are in a particular order, | 801.99 | 3.03 |
like item number 1, item
number 2, item number 3. | 805.02 | 3.19 |
And we have unordered lists for lists
that don't have any particular order. | 808.21 | 3.39 |
So just bullet point, bullet
point, bullet point, for example. | 811.6 | 2.93 |
And both are quite easy to use. | 814.53 | 2.37 |
I'll go ahead and create a new file. | 816.9 | 2.43 |
And we'll call this lists.html. | 819.33 | 2.94 |
And again, in list.html, I'll copy
the same structure from hello.html. | 822.27 | 4.51 |
We're again going to have DOCTYPE html
just to indicate the version of HTML. | 826.78 | 4.46 |
Most of the heading is the same. | 831.24 | 1.35 |
I'm just going to change the
title from Hello to Lists. | 832.59 | 3.3 |
And then we're going to
replace the body of this page | 835.89 | 2.28 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.