@@ -9,8 +9,11 @@ As well as useful links to learn more */
99 It sets out the colours, fonts, styles etc to be used in this design
1010 At work, a designer will give these to you based on the corporate brand, but while you are learning
1111 You can design it yourself if you like
12+
1213 Inspect the starter design with Devtools
14+
1315 Click on the colour swatches to see what is happening
16+
1417 I've put some useful CSS you won't have learned yet
1518 For you to explore and play with if you are interested
1619 https://web.dev/articles/min-max-clamp
@@ -41,34 +44,60 @@ svg {
4144 width : 100% ;
4245 object-fit : cover;
4346}
47+
48+ /* ====== Header Layout ====== */
49+ header {
50+ padding : var (--space );
51+ text-align : center;
52+ }
53+ header h1 {
54+ font-size : 2rem ;
55+ margin-bottom : var (--space );
56+ }
57+ header p {
58+ font-size : 1.2rem ;
59+ color : gray;
60+ }
61+
4462/* ====== Site Layout ======
4563Setting the overall rules for page regions
4664https://www.w3.org/WAI/tutorials/page-structure/regions/
4765*/
4866main {
4967 max-width : var (--container );
50- margin : 0 auto calc (var (--space ) * 4 ) auto;
68+ margin : 0 auto calc (var (--space ) * 6 ) auto;
69+ padding-bottom : calc (var (--space ) * 4 );
5170}
52- footer {
53- position : fixed;
54- bottom : 0 ;
55- text-align : center;
56- }
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- main {
71+
72+ /* ====== Articles Grid Layout ====
73+ Setting the rules for how articles are placed in the main element.
74+ Inspect this in Devtools and click the "grid" button in the Elements view
75+ Play with the options that come up.
76+ https://developer.chrome.com/docs/devtools/css/grid
77+ https://gridbyexample.com/learn/
78+ */
79+ section {
6580 display : grid;
6681 grid-template-columns : 1fr 1fr ;
6782 gap : var (--space );
68- > * : first-child {
83+ }
84+
85+ section > article : first-child {
6986 grid-column : span 2 ;
7087 }
88+
89+
90+ /* added padding, width and border top to the footer*/
91+ footer {
92+ position : fixed;
93+ bottom : 0 ;
94+ text-align : center;
95+ width : 100% ;
96+ padding : var (--space );
97+ border-top : var (--line );
98+ background-color : var (--paper );
7199}
100+
72101/* ====== Article Layout ======
73102Setting the rules for how elements are placed in the article.
74103Now laying out just the INSIDE of the repeated card/article design.
@@ -80,10 +109,35 @@ article {
80109 text-align : left;
81110 display : grid;
82111 grid-template-columns : var (--space ) 1fr var (--space );
83- > * {
112+ grid-template-rows : auto auto auto auto;
113+ margin-bottom : calc (var (--space ) * 2 );
114+ border-radius : 6px ;
115+ box-shadow : 0 1px 4px rgba (0 , 0 , 0 , 0.05 );
116+ }
117+
118+ article > * {
84119 grid-column : 2 / 3 ;
85120 }
86- > img {
87- grid-column : span 3 ;
88- }
121+
122+ /* Force consistent image height */
123+ article > img {
124+ aspect-ratio : 2 / 1 ;
125+ height : auto;
126+ width : 100% ;
127+ object-fit : contain;
128+ display : block;
129+ background-color : white;
130+ box-sizing : border-box;
131+ margin-bottom : 0 ; /* no extra space */
132+ border-bottom : 1px solid var (--ink ); /* 🪄 this is the key fix */
133+ }
134+
135+ /* Make the <hr> look like your wireframe divider */
136+ article hr {
137+ grid-column : 2 / 3 ;
138+ border : none;
139+ height : 1px ;
140+ background-color : var (--ink );
141+ opacity : 0.4 ;
142+ margin : calc (var (--space ) * 1.5 ) 0 ;
89143}
0 commit comments