- index.html
- style.css
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Perfect centering, flex alignment</title>
<link href="course.css" rel="stylesheet">
<link href="style.css" rel="stylesheet">
</head>
<body class="subtle">
<article class="item">
<h1>“Wolverine” Scratching Post</h1>
<div class="pictures">
<div class="picture">
<img src="img/toy.png" alt="">
</div>
<div class="picture">
<img src="img/toy.png" alt="">
</div>
</div>
<div class="controls">
<a href="/">Buy</a>
</div>
</article>
</body>
</html>
CSS
.pictures {
display: flex;
}
.picture {
margin: auto;
}
You’ve gone to a different page
Goalscompleted
0
- Remove
margin: auto
from the.picture
blocks, - then set flex items to be distributed along the center of the main axis for the
.pictures
block, - and center-align the cross axis.
- Then substitute
space-around
for arrangement along the main axis.
Comments