text
stringlengths
1
81
start
float64
0
10.1k
duration
float64
0
24.9
this particular part of the HTML page.
3,649.5
3.72
So that now is the ability to add fonts to our page too.
3,653.22
4.77
Another thing that we might want to do is
3,657.99
1.8
to be able to add some sort of border around our HTML elements.
3,659.79
3.87
So maybe I want a line to be able to separate this entire part of the page
3,663.66
4.11
from another part of the page.
3,667.77
1.53
So I could add a border by going to this div and saying,
3,669.3
2.95
let me give this div a border.
3,672.25
1.49
And maybe I want the border to be like a 3 pixel solid black border,
3,673.74
5.94
for instance.
3,679.68
0.93
I can specify how big I want the border to be.
3,680.61
2.76
I can specify whether I want the border to be a solid line
3,683.37
2.58
or a dashed or dotted line.
3,685.95
1.68
And I can specify what color I would like that border to be as well.
3,687.63
4.48
So now, when I refresh this, I now see I have
3,692.11
2.18
a border around this entire section, around
3,694.29
2.16
this entire div, inside of my web page.
3,696.45
3.72
And you can imagine these borders being helpful for styling
3,700.17
2.97
various different parts of my page.
3,703.14
2.05
So, for example, if we go back to that table
3,705.19
2.04
that we were looking at a moment ago when we were dealing with oceans, where
3,707.23
3.17
I had Ocean and Pacific Ocean and Atlantic Ocean,
3,710.4
3
this is structured in the format of a table.
3,713.4
2.22
We have rows and columns.
3,715.62
1.71
But it doesn't look great right now.
3,717.33
1.89
I might like to add some styling in order
3,719.22
2.4
to improve the way that this table looks, for example.
3,721.62
3.55
So let's give that a try.
3,725.17
1.85
I'll go ahead and go back into table.html,
3,727.02
2.73
that HTML file I was using before where I had this table.
3,729.75
3.21
And let me now add some style information to this table.
3,732.96
4.17
I might say that for this table I would like
3,737.13
2.1
to give it a border that is maybe a 1 pixel solid black border,
3,739.23
6.11
such that now when I refresh the page, I have a 1 pixel solid black border
3,745.34
4.38
around the entirety of the table.
3,749.72
2.21
All right, that's great.
3,751.93
1
But I also really wanted a border in between the rows and the columns
3,752.93
3.48
as well.
3,756.41
0.69
In particular, every table data item, I might
3,757.1
2.76
like to have some additional CSS supplied to those too.
3,759.86
4.56
So I might say for every table data cell--
3,764.42
2.46
again td stood for table data, and those were
3,766.88
2.7
the individual cells within my table--
3,769.58
2.55
I might specify that I would like those to also
3,772.13
2.16
have a border that is 1 pixel solid black, such that now I
3,774.29
5.68
refresh the page.
3,779.97
1.27
And now, each of my table data cells also has a border around it.
3,781.24
4.04
Now, this applied to the table data cells in the body of my page,
3,785.28
3.42
but it didn't yet apply to these cells up in the heading.
3,788.7
3.09
And that's because those were th elements, table headers.
3,791.79
5.58
And so here, we have a couple of options.
3,797.37
2.17
I could specify, once more, table headers
3,799.54
2.78
I would like to give a border of 1 pixel solid black.
3,802.32
4.44
But when I do so, you'll see that it does create a border around those table
3,806.76
3.51
headers.
3,810.27
0.93
But again, one thing that should be crossing your mind now
3,811.2
2.43
is that there's a fair amount of redundancy here, some repeated style
3,813.63
3.15
code that shows up in multiple different places.
3,816.78
2.28
Table data cells in the body of my page, I really
3,819.06
3.45
want to be styled in a very similar way to table header cells.
3,822.51
3.59
And so it'd be nice if I could somehow consolidate these two different CSS
3,826.1
5.05
selectors, these ways of me saying, style table data, style table headers.
3,831.15
4.47
I'd like to combine them into one.
3,835.62
2.58
And you can, in fact, do this in CSS.
3,838.2
1.89
There are a number of different CSS selectors, ways of choosing elements.
3,840.09
4.47
And one of them is just called the multiple element selector,
3,844.56
3.66
that if I want to select both table data cells and table headers,
3,848.22
4.23
then I can do so by saying td comma th and delete these three lines
3,852.45
6.78
down there.
3,859.23
1.47
What these three lines are now saying are
3,860.7
2.07
that I would like to style all table data cells and table
3,862.77
3.6
headers in the same way.
3,866.37
1.45
And I could even combine table if I wanted to for good measure.
3,867.82
2.64
But I'd like to give all of them a border of 1 pixel solid black, such
3,870.46
4.56
that now I refresh it and now I see that they all have this border around them.
3,875.02
4.44
Now, most tables you see on the internet don't have both a table or a border
3,879.46
3.62
around everything on the table and also a border
3,883.08
2.7
around each of the individual cells.
3,885.78
2.04
Usually, those are collapsed just into a single line.
3,887.82
2.92
And it turns out that CSS has an easy way for you to do this as well.
3,890.74
3.54
I can add a CSS property to the table called border collapse and just say,
3,894.28
5.45
I would like to collapse all of the borders in the table.
3,899.73
3.45
Just going to show you there are many, many different CSS properties, far more
3,903.18
3.3
than we'll be looking at today.
3,906.48
1.44
But they're easy things to reference, that you can easily
3,907.92
2.37
look up how to collapse borders in a table
3,910.29
2.29
and then find a CSS property like this that you can then use and apply
3,912.58
3.62
to your web page.
3,916.2
1.78
So now I refresh that.
3,917.98
1.35
And now I see that I have a border, just a single border, around all
3,919.33
3.71
of the cells in this particular page.
3,923.04
3.84
Next, what I might like to do, though, is like add some space around here.
3,926.88
3.16
Like it seems like this text is very tight against the border of this table.
3,930.04
4.74
So in order to do so, I want to add some spacing.
3,934.78
2.78
And recall again, do I want margin or padding?
3,937.56
2.52
Margin is spacing around side of the border of a particular HTML element,
3,940.08
5.28
whereas padding is inside of the border.
3,945.36
2.56
So if I want some space inside of the border,
3,947.92
2.3
just to space out the text from the border itself, then what I want
3,950.22
3.15
is padding inside of all of my table cells.
3,953.37
3.36