text stringlengths 1 81 | start float64 0 10.1k | duration float64 0 24.9 |
|---|---|---|
And now, let me just
add some sample text. | 5,562.88 | 1.77 |
So this is some sample text
inside of a div to demo flexbox. | 5,564.65 | 6.21 |
And I'll go ahead and repeat
this may maybe like 12 times. | 5,570.86 | 2.56 |
And I'll number each one. | 5,573.42 | 1.05 |
Here's 1, 2, 3, 4, and
I'll number all the rest. | 5,574.47 | 5.15 |
This is just to give a demonstration
of what these elements could actually | 5,579.62 | 3.87 |
look like. | 5,583.49 | 1.83 |
Ideally, these would be different
pieces of content, though. | 5,585.32 | 3.88 |
So now, inside of my
style tag, here's what | 5,589.2 | 3.48 |
I'm going to say, just to demonstrate. | 5,592.68 | 2.1 |
I'll say, take the ID container--
again the hashtag specifies get me | 5,594.78 | 3.78 |
something with a particular ID. | 5,598.56 | 2.13 |
And I want to display it using flexbox. | 5,600.69 | 3.81 |
And in particular, I would
like to use the flex wrap | 5,604.5 | 2.34 |
property to say if there's not enough
room at the end of a line for all | 5,606.84 | 3.81 |
of the elements, go ahead and
wrap around those elements | 5,610.65 | 2.98 |
onto the next line instead. | 5,613.63 | 3.41 |
And now, I can specify some
additional CSS properties | 5,617.04 | 3.48 |
for the divs inside of the container. | 5,620.52 | 3.06 |
So I can say, for the container all
of the div inside of that container, | 5,623.58 | 4.56 |
again using this child
selector to get all | 5,628.14 | 2.31 |
of the divs that are
inside of the container, | 5,630.45 | 2.91 |
I can add some CSS to that too. | 5,633.36 | 2.08 |
I can say, let's give these a background
color of like a shade of green. | 5,635.44 | 3.92 |
I can give them a particular
font, maybe 20 pixel font. | 5,639.36 | 3.66 |
Give them some margin and
padding, just to add some space. | 5,643.02 | 3.45 |
And maybe each one is going
to be 200 pixels wide. | 5,646.47 | 3.45 |
So just adding some spacing
to those individual divs, | 5,649.92 | 2.88 |
the important part is
this right here, where | 5,652.8 | 2.49 |
I've said that this whole container
is going to be a flexbox container. | 5,655.29 | 3.91 |
And I'd like to wrap around
elements if you ever reach the end. | 5,659.2 | 4.11 |
So now, I'll open up flexbox.html. | 5,663.31 | 3.37 |
And so here, I now see 12 elements
that are on multiple lines. | 5,666.68 | 4.52 |
But notice what happens
as I shrink the page. | 5,671.2 | 2.51 |
If there isn't room for all of them,
elements move onto other lines. | 5,673.71 | 3.96 |
Now, there's only three
elements in any particular row. | 5,677.67 | 2.56 |
Now, there's only two elements
on any particular row. | 5,680.23 | 2.35 |
And so I can use flexbox
to very well adapt myself | 5,682.58 | 3.63 |
to different sized screens. | 5,686.21 | 1.12 |
And no matter whether you're looking at
this on a big screen or a small screen, | 5,687.33 | 3.51 |
the content is still going to look good,
because I'm able to adapt responsively | 5,690.84 | 4.5 |
to whatever might be happening. | 5,695.34 | 2.02 |
So this is one layout paradigm that
exists within CSS, this flexbox layout. | 5,697.36 | 4.61 |
There are other layouts
that exist as well. | 5,701.97 | 2.04 |
One common one is the
grid layout for anytime | 5,704.01 | 2.43 |
you want to arrange things
in a particular grid, where | 5,706.44 | 2.82 |
maybe certain columns
need to be certain widths, | 5,709.26 | 2.07 |
but others can maybe be a
little bit more flexible. | 5,711.33 | 3 |
I'll show one example of that too, just
to give you a demonstration of what | 5,714.33 | 3.24 |
that grid layout might look like. | 5,717.57 | 2.5 |
So here's grid.html, where I'll go
ahead and inside the body of this page, | 5,720.07 | 5.69 |
give myself a div. | 5,725.76 | 2.1 |
I'll give it an ID of grid. | 5,727.86 | 3.51 |
And then let me just add
div class equals grid item. | 5,731.37 | 4.8 |
Again, a class, because there
might be multiple items, | 5,736.17 | 3.15 |
but I'll go ahead and just create
a whole bunch of grid items | 5,739.32 | 2.81 |
and number each one, so 2, 3,
4, 5, 6, 7, 8, 9, 10, 11, 12. | 5,742.13 | 7.24 |
So I have a whole bunch of grid items
inside of a div whose ID is grid. | 5,749.37 | 5.19 |
And now, I'd like to
add some style here. | 5,754.56 | 3.84 |
I'll say for the grid, let's
give it a background color. | 5,758.4 | 3.61 |
Maybe the background
color should be green. | 5,762.01 | 2.88 |
Display is going to be grid. | 5,764.89 | 1.86 |
I want this to show up as a grid. | 5,766.75 | 1.74 |
And now, there are a couple
of attributes or properties | 5,768.49 | 3.09 |
that I'm going to specify here. | 5,771.58 | 1.48 |
Maybe I want some padding
around the grid first. | 5,773.06 | 2 |
But the important grid
properties are grid column gap. | 5,775.06 | 4.59 |
How much space goes between
each of the columns? | 5,779.65 | 3.3 |
Maybe I'll say like 20 pixels. | 5,782.95 | 2.16 |
Likewise there is also a grid row gap. | 5,785.11 | 2.07 |
How much space goes between
each of the rows of the grid? | 5,787.18 | 2.94 |
Maybe I'll say 10 pixels here. | 5,790.12 | 2.11 |
And then finally, grid template
columns is a way for me | 5,792.23 | 4.19 |
to specify how many columns
there are going to be | 5,796.42 | 3.09 |
and how wide should each
of those columns be. | 5,799.51 | 2.55 |
So if I want maybe three columns,
I can specify that the first column | 5,802.06 | 4.23 |
should be 200 pixels. | 5,806.29 | 1.93 |
The second column should
also be 200 pixels. | 5,808.22 | 2.81 |
And the third column can
be automatically sized, | 5,811.03 | 2.88 |
just grow or shrink to fill the screen. | 5,813.91 | 2.45 |
So we'll say auto. | 5,816.36 | 1.52 |
So first column 200 pixels,
second column 200 pixels, | 5,817.88 | 3.62 |
third column just do it automatically. | 5,821.5 | 3.18 |
And now, for all of the
grid items, well, those I | 5,824.68 | 3.66 |
can add some styling to as well. | 5,828.34 | 1.92 |
I'll give them a
background color of white, | 5,830.26 | 1.8 |
just to distinguish them, and also give
them some font size and some padding | 5,832.06 | 5.66 |
and maybe center them as well. | 5,837.72 | 1.66 |
So just adding some additional
CSS properties in order | 5,839.38 | 2.97 |
to make it display the way I want to. | 5,842.35 | 1.62 |
But the important ones to care
about here are display is grid. | 5,843.97 | 3.93 |
And then I'm specifying,
here is how the grid | 5,847.9 | 2.58 |
should be laid out, how
much space between columns, | 5,850.48 | 2.28 |
how much space between rows, and how
wide are each of those rows going | 5,852.76 | 4.05 |
to be. | 5,856.81 | 1.2 |
Now, if I open up, grid.html,
here's what that grid looks like. | 5,858.01 | 4.92 |
I now have a first
column 200 pixels wide, | 5,862.93 | 2.84 |
a second column also 200
pixels wide, and a third column | 5,865.77 | 3.61 |
that's going to resize
dynamically based on how wide | 5,869.38 | 2.85 |
or how narrow my screen happens to be. | 5,872.23 | 2.1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.