Hi.
I’m with the tribute page.
I don’t understand why code tells me my #image should have a display
of block
and should have a max-width
of 100%
.
Isn’t already the case ?
" Your #image
should be centered within its parent.
Parent = main has display: flex and align-items: center;. Isn’t this okay ? I don’t know what to do and I have same problem with a smaller image
Thank you in advance
index.html
<!DOCTYPE html>
<html lang="fr">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8">
<title>Akira Toriyama tribute page</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<main id="main">
<div id="top">
<h1 id="title">Akira Toriyama</h1>
<p>Le père de san Goku</p>
</div>
<div id="img-div">
<img id="image" src="https://wallpapers.com/images/hd/dragon-ball-z-characters-1920-x-1080-wallpaper-xb57gfjkdihe8ewi.jpg">
<figcaption id="img-caption">San Goku, personnage principal du manga Dragon Ball</figcaption>
</div>
<div id="tribute-info">
<h2>Connu principalement pour ses mangas Dragon Ball et Dragon Ball Z, Akira Toriyama s'est fait connaître pour ses personnages mignons et loufoques</h2>
<p>Après avoir quitté le circuit scolaire, Akira Toriyama tente plusieurs concours auprès d'éditeurs de mangas. Il continuera à persévérer à la suite d'un appel de Kazuhiko Torishima, le directeur de la maison d'édition Hakusensha, qui deviendra plus tard son rédacteur en chef.</p>
<p><a href="https://fr.wikipedia.org/wiki/Akira_Toriyama" target="_blank" id="tribute-link"></a> </p>
</div>
</main>
</body>
</html>
style.css
main {
display: flex;
flex-direction: column;
align-items: center;
font-family: Arial, Helvetica, sans-serif;
font-size: 1.4rem;
}
#top {
margin: 50px;
}
#image {
max-width: 100%;
display: block;
border: 3px solid #000;
margin: 0 auto;
height: auto;
}
#tribute-info {
margin: 40px;
width: 60%;
border: 2px red solid;
}
#img-caption {
padding: 1.5em;
}
#title {
font-size: 3rem;
}
h2, p {
margin: 2em;
}