Tribute Page - Build a Tribute Page

how to centered #image within its parent?

My code so far

<!-- file: index.html -->
<html lang=en>
<head>
  <link rel="stylesheet" href="styles.css">
</head>

<body>
  <main id="main">
    <h1 id="title">EREN YEEGAH</h1>
    <div id="img-div">
      <img id="image" src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTnGFJkNLRlgX8XKOCAv388rcQx9uyW3nN6nw&usqp=CAU">
      <div id="img-caption">abang gue nih</div>
    </div>

<div id="tribute-info">
  <h3 id="info">kisah kelam</h3>
  <ul>
    <li>ibunya dimakan titan</li>
    <li>bapaknya juga</li>
    <li>melihat masa depan yg dihancurkannya</li>
  </ul>
  <h3>dia adalah seorang <a id="tribute-link" href="www.titan" target="_blank">titan</h3>
</div>

    </main>


  </html>
/* file: styles.css */


h1{
  text-align: center;
}

image{
  max-width: 100%;
  height: auto;
 justify-content: center;
}

img{
  display: block;
}


*{
  background-color: lightblue;
  font-family: arial;
  font-size: 
}

main{
  align: center;
}

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36

Challenge: Tribute Page - Build a Tribute Page

Link to the challenge:

Add the css rule for that id:

#image {
  display: block;
  max-width: 100%;
  height: auto;
  justify-content: center;
  margin: 0 auto;
}

Delete ‘img’ and ‘image’ selectors from your css code.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.