1
- /* Here are some starter styles
2
- You can edit these or replace them entirely
3
- It's showing you a common way to organise CSS
4
- And includes solutions to common problems
5
- As well as useful links to learn more */
6
-
7
- /* ====== Design Palette ======
8
- This is our "design palette".
9
- It sets out the colours, fonts, styles etc to be used in this design
10
- At work, a designer will give these to you based on the corporate brand, but while you are learning
11
- You can design it yourself if you like
12
- Inspect the starter design with Devtools
13
- Click on the colour swatches to see what is happening
14
- I've put some useful CSS you won't have learned yet
15
- For you to explore and play with if you are interested
16
- https://web.dev/articles/min-max-clamp
17
- https://scrimba.com/learn-css-variables-c026
18
- ====== Design Palette ====== */
19
1
: root {
2
+ --color : # 000 ;
20
3
--paper : oklch (7 0 0 );
21
4
--ink : color-mix (in oklab, var (--color ) 5% , black);
22
5
--font : 100% / 1.5 system-ui;
23
6
--space : clamp (6px , 6px + 2vw , 15px );
24
7
--line : 1px solid;
25
8
--container : 1280px ;
26
9
}
27
- /* ====== Base Elements ======
28
- General rules for basic HTML elements in any context */
29
10
body {
30
- background : var (--paper );
31
- color : var (--ink );
11
+ background : var (--paper );
12
+ color : var (--ink );
32
13
font : var (--font );
33
14
}
34
15
a {
@@ -41,43 +22,41 @@ svg {
41
22
width : 100% ;
42
23
object-fit : cover;
43
24
}
44
- /* ====== Site Layout ======
45
- Setting the overall rules for page regions
46
- https://www.w3.org/WAI/tutorials/page-structure/regions/
47
- */
25
+ header {
26
+ text-align : center;
27
+ color : rgb (18 , 87 , 114 );
28
+ background-color : beige;
29
+ font-size : larger;
30
+ padding : 2rem ;
31
+ }
48
32
main {
49
33
max-width : var (--container );
50
34
margin : 0 auto calc (var (--space ) * 4 ) auto;
51
35
}
52
36
footer {
53
37
position : fixed;
54
38
bottom : 0 ;
55
- text-align : center;
39
+ width : 100% ;
40
+ background-color : beige;
41
+ text-align : left;
42
+
56
43
}
57
- /* ====== Articles Grid Layout ====
58
- Setting the rules for how articles are placed in the main element.
59
- Inspect this in Devtools and click the "grid" button in the Elements view
60
- Play with the options that come up.
61
- https://developer.chrome.com/docs/devtools/css/grid
62
- https://gridbyexample.com/learn/
63
- */
64
44
main {
65
45
display : grid;
66
46
grid-template-columns : 1fr 1fr ;
67
47
gap : var (--space );
68
- > * : first-child {
48
+ > * : first-child {
69
49
grid-column : span 2 ;
70
50
}
71
51
}
72
- /* ====== Article Layout ======
73
- Setting the rules for how elements are placed in the article.
74
- Now laying out just the INSIDE of the repeated card/article design.
75
- Keeping things orderly and separate is the key to good, simple CSS.
76
- */
52
+ .main-title {
53
+ font-family : cursive;
54
+ font-style : italic;
55
+ }
77
56
article {
78
57
border : var (--line );
79
58
padding-bottom : var (--space );
80
- text-align : left ;
59
+ text-align : center ;
81
60
display : grid;
82
61
grid-template-columns : var (--space ) 1fr var (--space );
83
62
> * {
@@ -86,4 +65,4 @@ article {
86
65
> img {
87
66
grid-column : span 3 ;
88
67
}
89
- }
68
+ }
0 commit comments