text
stringlengths
1
81
start
float64
0
10.1k
duration
float64
0
24.9
going to be associated with a list called countries.
2,081.55
4.32
Then immediately below that I have a data list element whose
2,085.87
3.53
ID is countries, where here, I'm going to specify these
2,089.4
3.25
are all of the options for what country we could have.
2,092.65
3.15
Each one is inside of an option element whose value
2,095.8
2.87
is whatever country they could select.
2,098.67
2.35
And we have all of the countries of the world listed in these option elements.
2,101.02
5.11
So this input here is going to allow me to select one option from a list of all
2,106.13
4.79
of these possible options.
2,110.92
1.96
So now, if I open up form1.html.
2,112.88
4.21
Here's what that form ultimately looks like.
2,117.09
2.69
I can, here, inside of the name field--
2,119.78
1.95
again, that word name shows up, because it's the placeholder--
2,121.73
3.03
I can type in my name here.
2,124.76
1.83
And inside of the password field anything I type
2,126.59
2.67
is going to show up as just little dots instead
2,129.26
2.4
of the actual characters, because the type of that input field was password,
2,131.66
4.23
instead of the type being text.
2,135.89
2.55
In favorite color, I now have the ability
2,138.44
1.98
to choose between various different favorite color options.
2,140.42
2.97
In a radio button format, I choose from one of a number of options.
2,143.39
3.33
And finally, inside this country dropdown,
2,146.72
2.82
I have the ability now when I click on it to see all of the countries,
2,149.54
3.61
but as I start to type letters, like u-n-i-t,
2,153.15
3.32
it filters down to only the options that I actually care about.
2,156.47
3.76
So here if I type in enough letters, eventually I see United States.
2,160.23
3.86
And I can click on that option as well.
2,164.09
2.65
So HTML5 builds in these additional features
2,166.74
3.14
to make it easy to implement something like a text field, where it will auto
2,169.88
3.42
complete based on the text that you provide.
2,173.3
2.22
You can just specify that it is inside of this data list
2,175.52
4.2
and then provide a list of all the possible values.
2,179.72
2.43
And then HTML and your web browser in turn
2,182.15
2.58
will take care of the process of rendering that information in the way
2,184.73
3.15
that you expect it to be displayed.
2,187.88
3.78
So those are just some of the possible HTML elements
2,191.66
2.6
that we can ultimately create by using these various different elements
2,194.26
3.69
that we nest within each other.
2,197.95
1.52
And there are definitely other HTML elements
2,199.47
2.02
that exist as well that you can begin to explore.
2,201.49
2.61
But all of them follow a very similar pattern
2,204.1
2.17
that we're going to have some tag, that might require
2,206.27
2.21
some attributes, additional information about the HTML,
2,208.48
3.3
to give context to the web browser for how that element should be displayed.
2,211.78
3.93
Maybe that element needs to have a particular source for an image.
2,215.71
3.12
Maybe it needs a link in order to link to somewhere, or other information
2,218.83
3.15
as well.
2,221.98
0.78
And then inside of that element, you might nest other elements.
2,222.76
2.7
So that your table has rows.
2,225.46
1.86
And inside of those rows, we have other cells.
2,227.32
2.16
And you might imagine nesting elements inside
2,229.48
2.55
of other elements inside of other elements.
2,232.03
2.83
But right now so far, all of our web pages have been rather simple.
2,234.86
3.7
They've just been-- we've described the structure of the page,
2,238.56
2.59
and we've described we want a list here, we want to form there.
2,241.15
3.02
What we might really like is some way of specifying that we
2,244.17
2.89
want to style our web page in some way.
2,247.06
2.28
We want to add color.
2,249.34
0.93
We want add spacing.
2,250.27
1.26
We want to add some sort of other layout to our page as well.
2,251.53
3.48
And in order to do that, we're going to use a second language
2,255.01
2.97
that we're going to call CSS, short for Cascading Style Sheets.
2,257.98
3.48
In particular, we'll use the latest version
2,261.46
1.8
of CSS, CSS3, which gives us the ability to take an HTML page
2,263.26
5.1
and tell the web browser how we would like it to be styled.
2,268.36
3.06
Instead of just black text in the same font on a white background,
2,271.42
3.48
we can begin to specify particular CSS properties of how
2,274.9
4.2
we would like this page to look to make sure that the page looks
2,279.1
3.15
the way we want it to.
2,282.25
1.71
So let's take a look at a simple example now of CSS
2,283.96
3.57
to take a look at how we can add some CSS code to our page.
2,287.53
5.27
So I'll go ahead and create a new file that I'll call style.html,
2,292.8
5.58
just to demonstrate some basic ideas of adding some style to our page.
2,298.38
3.99
And we'll go ahead and copy the same hello.html from before.
2,302.37
3.96
And maybe in addition to hello world, I display in h1 some big heading
2,306.33
4.02
at the top that says like, Welcome to my web page, for example.
2,310.35
5.44
So now, if I open up, style.html, this is what I see.
2,315.79
4.38
I see a big heading at the top that says welcome to my web page,
2,320.17
2.85
beneath which is just the text, hello world.
2,323.02
3.32
And now imagine that I want to add some style
2,326.34
2.37
to this heading at the top of the page.
2,328.71
2.16
Maybe instead of being left aligned, I want it to be centered.
2,330.87
2.64
Maybe instead of just being black text, I'd like to change the color.
2,333.51
3.27
In order to do that, just as we've used attributes
2,336.78
3.24
in the past to add additional information to this particular HTML
2,340.02
4.26
page, we can do a very similar thing with CSS.
2,344.28
3.42
We can specify that we're going to give this h1 element a style attribute.
2,347.7
5.24
And that is going to be equal to.
2,352.94
1.54
And then in quotation marks, we're going to provide all of the CSS properties
2,354.48
4.59
that we would like to add to this particular element.
2,359.07
2.97
So the way that CSS styling works is that we can give elements
2,362.04
3.78
individual CSS properties, where a property is
2,365.82
2.97
something like the color of the element or the alignment of the element.
2,368.79
3.8
And each of those properties has a default value.
2,372.59
2.53
But we can change its value to something else.
2,375.12
2.73
So if, for example, I wanted to change the color of this heading,
2,377.85
3.78
so that instead of a black heading, it displayed as the blue heading,
2,381.63
3.42
I could say for this h1, I would like to give it a color property.
2,385.05
4.59
And then to give the color property of value,
2,389.64
2.25
I say color colon and then the value that I would like to give to it.
2,391.89
3.78