File tree 8 files changed +329
-0
lines changed
8 files changed +329
-0
lines changed Original file line number Diff line number Diff line change
1
+ <!doctype html>
2
+
3
+ < html lang ="en ">
4
+
5
+ < head >
6
+ < meta charset ="utf-8 ">
7
+
8
+ < title > CSS Cookbook: center an element</ title >
9
+
10
+ < link rel ="stylesheet " href ="styles.css ">
11
+
12
+ < style >
13
+ .container {
14
+ height : 200px ;
15
+ display : flex;
16
+ align-items : center;
17
+ justify-content : center;
18
+ border : 2px solid rgb (75 , 70 , 74 );
19
+ border-radius : .5em ;
20
+ }
21
+
22
+ .item {
23
+ width : 10em ;
24
+ border : 2px solid rgb (95 , 97 , 110 );
25
+ border-radius : .5em ;
26
+ padding : 20px ;
27
+ }
28
+ </ style >
29
+
30
+ </ head >
31
+
32
+ < body >
33
+ < div class ="container ">
34
+ < div class ="item "> I am centered!</ div >
35
+ </ div >
36
+ </ body >
37
+
38
+ </ html >
Original file line number Diff line number Diff line change
1
+ <!doctype html>
2
+
3
+ < html lang ="en ">
4
+
5
+ < head >
6
+ < meta charset ="utf-8 ">
7
+
8
+ < title > CSS Cookbook: columns with flexbox, wrapping</ title >
9
+
10
+ < link rel ="stylesheet " href ="styles.css ">
11
+
12
+ < style >
13
+ .container {
14
+ border : 2px solid rgb (75 , 70 , 74 );
15
+ border-radius : .5em ;
16
+ padding : 20px 10px ;
17
+ width : 500px ;
18
+ display : flex;
19
+ flex-wrap : wrap;
20
+ }
21
+
22
+ .container > * {
23
+ margin : 0 10px ;
24
+ flex : 1 1 200px ;
25
+ padding : 10px ;
26
+ border : 2px solid rgb (95 , 97 , 110 );
27
+ border-radius : .5em ;
28
+ }
29
+ </ style >
30
+
31
+ </ head >
32
+
33
+ < body >
34
+ < div class ="container ">
35
+ < p > Veggies es bonus vobis, proinde vos postulo essum magis kohlrabi welsh onion daikon amaranth tatsoi tomatillo
36
+ melon azuki bean garlic.</ p >
37
+
38
+ < p > Gumbo beet greens corn soko endive gumbo gourd. Parsley shallot courgette tatsoi pea sprouts fava bean collard
39
+ greens dandelion okra wakame tomato. Dandelion cucumber earthnut pea peanut soko zucchini.</ p >
40
+
41
+ < p > Nori grape silver beet broccoli kombu beet greens fava bean potato quandong celery. Bunya nuts black-eyed pea
42
+ prairie turnip leek lentil turnip greens parsnip. Sea lettuce lettuce water chestnut eggplant winter purslane
43
+ fennel azuki bean earthnut pea sierra leone bologi leek soko chicory celtuce parsley jícama salsify.</ p >
44
+ </ div >
45
+ </ body >
46
+
47
+ </ html >
Original file line number Diff line number Diff line change
1
+ <!doctype html>
2
+
3
+ < html lang ="en ">
4
+
5
+ < head >
6
+ < meta charset ="utf-8 ">
7
+
8
+ < title > CSS Cookbook: columns with flexbox</ title >
9
+
10
+ < link rel ="stylesheet " href ="styles.css ">
11
+
12
+ < style >
13
+ .container {
14
+ border : 2px solid rgb (75 , 70 , 74 );
15
+ border-radius : .5em ;
16
+ padding : 20px 10px ;
17
+ display : flex;
18
+ }
19
+
20
+ .container > * {
21
+ margin : 0 10px ;
22
+ padding : 10px ;
23
+ border : 2px solid rgb (95 , 97 , 110 );
24
+ border-radius : .5em ;
25
+ flex : 1 ;
26
+ }
27
+ </ style >
28
+
29
+ </ head >
30
+
31
+ < body >
32
+ < div class ="container ">
33
+ < p > Veggies es bonus vobis, proinde vos postulo essum magis kohlrabi welsh onion daikon amaranth tatsoi tomatillo
34
+ melon azuki bean garlic.</ p >
35
+
36
+ < p > Gumbo beet greens corn soko endive gumbo gourd. Parsley shallot courgette tatsoi pea sprouts fava bean collard
37
+ greens dandelion okra wakame tomato. Dandelion cucumber earthnut pea peanut soko zucchini.</ p >
38
+
39
+ < p > Turnip greens yarrow ricebean rutabaga endive cauliflower sea lettuce kohlrabi amaranth water spinach avocado
40
+ daikon napa cabbage asparagus winter purslane kale. Celery potato scallion desert raisin horseradish spinach
41
+ carrot soko. Lotus root water spinach fennel kombu maize bamboo shoot green bean swiss chard seakale pumpkin
42
+ onion chickpea gram corn pea. Brussels sprout coriander water chestnut gourd swiss chard wakame kohlrabi beetroot
43
+ carrot watercress. Corn amaranth salsify bunya nuts nori azuki bean chickweed potato bell pepper artichoke.</ p >
44
+
45
+ < p > Nori grape silver beet broccoli kombu beet greens fava bean potato quandong celery. Bunya nuts black-eyed pea
46
+ prairie turnip leek lentil turnip greens parsnip. Sea lettuce lettuce water chestnut eggplant winter purslane
47
+ fennel azuki bean earthnut pea sierra leone bologi leek soko chicory celtuce parsley jícama salsify.</ p >
48
+ </ div >
49
+ </ body >
50
+
51
+ </ html >
Original file line number Diff line number Diff line change
1
+ <!doctype html>
2
+
3
+ < html lang ="en ">
4
+ < head >
5
+ < meta charset ="utf-8 ">
6
+
7
+ < title > CSS Cookbook: columns with grid</ title >
8
+
9
+ < link rel ="stylesheet " href ="styles.css ">
10
+
11
+ < style >
12
+ .container {
13
+ border : 2px solid rgb (75 , 70 , 74 );
14
+ border-radius : .5em ;
15
+ padding : 20px ;
16
+ width : 500px ;
17
+ display : grid;
18
+ grid-template-columns : 1fr 1fr ;
19
+ grid-gap : 20px ;
20
+
21
+ }
22
+
23
+ .container > * {
24
+ padding : 10px ;
25
+ border : 2px solid rgb (95 , 97 , 110 );
26
+ border-radius : .5em ;
27
+ margin : 0 ;
28
+ }
29
+ </ style >
30
+
31
+ </ head >
32
+
33
+ < body >
34
+ < div class ="container ">
35
+ < p > Veggies es bonus vobis, proinde vos postulo essum magis kohlrabi welsh onion daikon amaranth tatsoi tomatillo melon azuki bean garlic.</ p >
36
+
37
+ < p > Gumbo beet greens corn soko endive gumbo gourd. Parsley shallot courgette tatsoi pea sprouts fava bean collard greens dandelion okra wakame tomato. Dandelion cucumber earthnut pea peanut soko zucchini.</ p >
38
+
39
+ < p > Nori grape silver beet broccoli kombu beet greens fava bean potato quandong celery. Bunya nuts black-eyed pea prairie turnip leek lentil turnip greens parsnip. Sea lettuce lettuce water chestnut eggplant winter purslane fennel azuki bean earthnut pea sierra leone bologi leek soko chicory celtuce parsley jícama salsify.</ p >
40
+ </ div >
41
+ </ body >
42
+ </ html >
Original file line number Diff line number Diff line change
1
+ <!doctype html>
2
+
3
+ < html lang ="en ">
4
+
5
+ < head >
6
+ < meta charset ="utf-8 ">
7
+
8
+ < title > CSS Cookbook: columns with multicol</ title >
9
+
10
+ < link rel ="stylesheet " href ="styles.css ">
11
+
12
+ < style >
13
+ .container {
14
+ border : 2px solid rgb (75 , 70 , 74 );
15
+ border-radius : .5em ;
16
+ padding : 20px ;
17
+ column-width : 10em ;
18
+ column-rule : 1px solid rgb (75 , 70 , 74 );
19
+ }
20
+ </ style >
21
+
22
+ </ head >
23
+
24
+ < body >
25
+ < div class ="container ">
26
+ < p > Veggies es bonus vobis, proinde vos postulo essum magis kohlrabi welsh onion daikon amaranth tatsoi tomatillo
27
+ melon azuki bean garlic.</ p >
28
+
29
+ < p > Gumbo beet greens corn soko endive gumbo gourd. Parsley shallot courgette tatsoi pea sprouts fava bean collard
30
+ greens dandelion okra wakame tomato. Dandelion cucumber earthnut pea peanut soko zucchini.</ p >
31
+
32
+ < p > Turnip greens yarrow ricebean rutabaga endive cauliflower sea lettuce kohlrabi amaranth water spinach avocado
33
+ daikon napa cabbage asparagus winter purslane kale. Celery potato scallion desert raisin horseradish spinach
34
+ carrot soko. Lotus root water spinach fennel kombu maize bamboo shoot green bean swiss chard seakale pumpkin
35
+ onion chickpea gram corn pea. Brussels sprout coriander water chestnut gourd swiss chard wakame kohlrabi beetroot
36
+ carrot watercress. Corn amaranth salsify bunya nuts nori azuki bean chickweed potato bell pepper artichoke.</ p >
37
+
38
+ < p > Nori grape silver beet broccoli kombu beet greens fava bean potato quandong celery. Bunya nuts black-eyed pea
39
+ prairie turnip leek lentil turnip greens parsnip. Sea lettuce lettuce water chestnut eggplant winter purslane
40
+ fennel azuki bean earthnut pea sierra leone bologi leek soko chicory celtuce parsley jícama salsify.</ p >
41
+ </ div >
42
+ </ body >
43
+
44
+ </ html >
Original file line number Diff line number Diff line change
1
+ <!doctype html>
2
+
3
+ < html lang ="en ">
4
+
5
+ < head >
6
+ < meta charset ="utf-8 ">
7
+
8
+ < title > CSS Cookbook: sticky footer with flexbox</ title >
9
+
10
+ < link rel ="stylesheet " href ="styles.css ">
11
+
12
+ < style >
13
+ body {
14
+ min-height : 100vh ;
15
+ display : flex;
16
+ flex-direction : column;
17
+ }
18
+
19
+ * {
20
+ box-sizing : border-box;
21
+ }
22
+
23
+ .page-header ,
24
+ .page-footer {
25
+ background-color : rgb (75 , 70 , 74 );
26
+ color : # fff ;
27
+ padding : 20px ;
28
+ flex-shrink : 0 ;
29
+ }
30
+
31
+ .page-body {
32
+ padding : 20px ;
33
+ flex-grow : 1 ;
34
+ }
35
+ </ style >
36
+
37
+ </ head >
38
+
39
+ < body >
40
+ < header class ="page-header "> This is the header</ header >
41
+ < article class ="page-body ">
42
+ < div class ="item "> Main page content here, add more if you want to see the footer push down.</ div >
43
+ </ article >
44
+ < footer class ="page-footer "> Sticky footer</ footer >
45
+ </ body >
46
+
47
+ </ html >
Original file line number Diff line number Diff line change
1
+ <!doctype html>
2
+
3
+ < html lang ="en ">
4
+
5
+ < head >
6
+ < meta charset ="utf-8 ">
7
+
8
+ < title > CSS Cookbook: sticky footer</ title >
9
+
10
+ < link rel ="stylesheet " href ="styles.css ">
11
+
12
+ < style >
13
+ body {
14
+ min-height : 100vh ;
15
+ display : grid;
16
+ grid-template-rows : auto 1fr auto;
17
+ }
18
+
19
+ * {
20
+ box-sizing : border-box;
21
+ }
22
+
23
+ .page-header ,
24
+ .page-footer {
25
+ background-color : rgb (75 , 70 , 74 );
26
+ color : # fff ;
27
+ padding : 20px ;
28
+ }
29
+
30
+ .page-body {
31
+ padding : 20px ;
32
+ }
33
+ </ style >
34
+
35
+ </ head >
36
+
37
+ < body >
38
+ < header class ="page-header "> This is the header</ header >
39
+ < article class ="page-body ">
40
+ < div class ="item "> Main page content here, add more if you want to see the footer push down.</ div >
41
+ </ article >
42
+ < footer class ="page-footer "> Sticky footer</ footer >
43
+ </ body >
44
+
45
+ </ html >
Original file line number Diff line number Diff line change
1
+ /* Some default styling for cookbook examples */
2
+ /*
3
+ rgb(53,43,34)
4
+ rgb(75,70,74)
5
+ rgb(95,97,110)
6
+ rgb(137,151,188)
7
+ rgb(160,178,226)
8
+ */
9
+ body {
10
+ background-color : # fff ;
11
+ color : # 333 ;
12
+ font : 1.2em / 1.5 Helvetica Neue, Helvetica, Arial, sans-serif;
13
+ padding : 0 ;
14
+ margin : 0 ;
15
+ }
You can’t perform that action at this time.
0 commit comments