Tribute Page - Build a Tribute Page

Tell us what’s happening:
how can #image be centered ?

**

Tribute Page Header

Image Caption
Tribute info **
<!-- file: index.html -->
<!DOCTYPE html>
<head>
  <link rel="stylesheet" href="styles.css">
</head>
<body>
<main id="main">
  <h1 id="title"> Tribute Page Header </h1>
  <div id="img-div">
    <img id="image" src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT4BUp3DJh6ZG8oLa6QiFg6sd_U5wgDsKXnKBYvOisP&s">
    <div id="img-caption">Image Caption</div>
    </img>
    </div>
    <div id="tribute-info">Tribute info
      <a id="tribute-link" href="https://www.google.co.uk"target="_blank"></a>
    </main>
</body>
</html>
  
/* file: styles.css */
#image{
display: block;
max-width: 100%;
height: auto%;
justify-content: center;
}

Your browser information:

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

Challenge: Tribute Page - Build a Tribute Page

Link to the challenge:

I personally used the margin :auto property as an attribute.

1 Like

use margin properties to figure it out.

1 Like

why are u using this:
</img>

image is selfclosing. doesnt need that tag!

1 Like

Thank you it was very helpful.

1 Like

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