HTML Diff
0 added 0 removed
Original 2026-01-01
Modified 2026-03-09
1 <p><b>Loading…</b>Everything will be ready in few seconds</p>
1 <p><b>Loading…</b>Everything will be ready in few seconds</p>
2 <ul><li>Theory</li>
2 <ul><li>Theory</li>
3 <li>Theory</li>
3 <li>Theory</li>
4 <li>Comments</li>
4 <li>Comments</li>
5 </ul><h2>Perfect centering, flex alignment</h2>
5 </ul><h2>Perfect centering, flex alignment</h2>
6 <p>Now let’s center the items using the flex container properties without margin: auto in the child elements.</p>
6 <p>Now let’s center the items using the flex container properties without margin: auto in the child elements.</p>
7 <p>Notice how items are distributed differently depending on the various values of the justify-content property.</p>
7 <p>Notice how items are distributed differently depending on the various values of the justify-content property.</p>
8 <h2>Comments</h2>
8 <h2>Comments</h2>
9 <ul><li>index.html</li>
9 <ul><li>index.html</li>
10 <li>style.css</li>
10 <li>style.css</li>
11 </ul><p>HTML</p>
11 </ul><p>HTML</p>
12 <p>&lt;!DOCTYPE html&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;meta charset="utf-8"&gt; &lt;title&gt;Perfect centering, flex alignment&lt;/title&gt; &lt;link href="course.css" rel="stylesheet"&gt; &lt;link href="style.css" rel="stylesheet"&gt; &lt;/head&gt; &lt;body class="subtle"&gt; &lt;article class="item"&gt; &lt;h1&gt;“Wolverine” Scratching Post&lt;/h1&gt; &lt;div class="pictures"&gt; &lt;div class="picture"&gt; &lt;img src="img/toy.png" alt=""&gt; &lt;/div&gt; &lt;div class="picture"&gt; &lt;img src="img/toy.png" alt=""&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="controls"&gt; &lt;a href="/"&gt;Buy&lt;/a&gt; &lt;/div&gt; &lt;/article&gt; &lt;/body&gt; &lt;/html&gt;</p>
12 <p>&lt;!DOCTYPE html&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;meta charset="utf-8"&gt; &lt;title&gt;Perfect centering, flex alignment&lt;/title&gt; &lt;link href="course.css" rel="stylesheet"&gt; &lt;link href="style.css" rel="stylesheet"&gt; &lt;/head&gt; &lt;body class="subtle"&gt; &lt;article class="item"&gt; &lt;h1&gt;“Wolverine” Scratching Post&lt;/h1&gt; &lt;div class="pictures"&gt; &lt;div class="picture"&gt; &lt;img src="img/toy.png" alt=""&gt; &lt;/div&gt; &lt;div class="picture"&gt; &lt;img src="img/toy.png" alt=""&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="controls"&gt; &lt;a href="/"&gt;Buy&lt;/a&gt; &lt;/div&gt; &lt;/article&gt; &lt;/body&gt; &lt;/html&gt;</p>
13 <p>CSS</p>
13 <p>CSS</p>
14 <p>.pictures { display: flex; } .picture { margin: auto; }</p>
14 <p>.pictures { display: flex; } .picture { margin: auto; }</p>
15 <p>Thanks! We’ll fix everything at once!</p>
15 <p>Thanks! We’ll fix everything at once!</p>
16 <p>The code has changed, click “Refresh” or turn autorun on.</p>
16 <p>The code has changed, click “Refresh” or turn autorun on.</p>
17 <p>You’ve gone to a different page</p>
17 <p>You’ve gone to a different page</p>
18 <p>Click inside the mini-browser to shift the focus onto this window.</p>
18 <p>Click inside the mini-browser to shift the focus onto this window.</p>
19 <p>100%</p>
19 <p>100%</p>
20 <ol><li>Remove margin: auto from the .picture blocks,</li>
20 <ol><li>Remove margin: auto from the .picture blocks,</li>
21 <li>then set flex items to be distributed along the center of the main axis for the .pictures block,</li>
21 <li>then set flex items to be distributed along the center of the main axis for the .pictures block,</li>
22 <li>and center-align the cross axis.</li>
22 <li>and center-align the cross axis.</li>
23 <li>Then substitute space-around for arrangement along the main axis.</li>
23 <li>Then substitute space-around for arrangement along the main axis.</li>
24 </ol>
24 </ol>