Help With Tribute Page(Display Block & Max-Width)

Can someone please tell me how I’m supposed to resolve the following errors:

  • Your img element should have a display of block.

  • Failed:Your #image should have a max-width of 100%.

I don’t understand what I’m doing wrong.
Your code so far

/* file: index.html */
<!DOCTYPE html>
<html>
	<html lang="en">
	<body>
<main id="main"> 
 <head>
   
 <h1 id="title">FREDDIE MERCURY</h1>
 <h2>Man, Musician, Legend</h2>
 
 <figure id="img-div">

 <img id="image"        src="https://lh3.googleusercontent.com/proxy/zGwcpNRLCAkVHq5l_4nBkpcj5cVfQEZuIJzhMJtFG_abU9pIyQCbybfrYP06UcKrcVH4iLgXVGH6i34eINQcahHDwjnh1E3Gep9dU93qi0KU8CZj5TSVwcI" 
alt="Freddy Mercury wearing Regalia"
      class="responsive-img">
   
   <figcaption id="img-caption">
   <em>Freddy Mercury wearing regalia at Wembley Stadium.</em>
 </figcaption>  
 </figure>

 <p id="tribute-info">
   Freddie Mercury (1946 – 1991) was a British singer, songwriter, record producer, and lead vocalist of the rock band Queen. Regarded as one of the greatest lead singers in the history of rock music, he was known for his flamboyant stage persona and four-octave vocal range.</p>
   
     <p class="quote"> <em>It's a beautiful day! The sun is shining..</em> </p>

   
 </head>
 
  <section>
    
    <ul>
   
      Some of Queen's most popular songs are:
      
     <li><strong>Killer Queen</strong> 
      The song's first verse quotes a phrase falsely attributed to Marie Antoinette: " 'Let them eat cake,' she says, Just like Marie Antoinette. "Killer Queen" retained the essence of Queen's trademark sound, particularly in its meticulous vocal harmonies.</li>
     <li><strong>Love of my life</strong> 
       This song is an example of Mercury's classical piano influences, notably by Chopin and Beethoven. Freddie Mercury wrote it on the piano and guitar first, and Brian May rearranged the song for acoustic 12-string guitar for live performances. </li>
     <li><strong>Bohemian Rhapsody</strong> 
      Although critical reaction was initially mixed, "Bohemian Rhapsody" became Queen's most popular song and is considered one of the greatest rock songs of all time.</li>
     <li><strong>We are the Champions</strong>
       This song has become an anthem for victories at sporting events, including as an official theme song for the 1994 FIFA World Cup, and has been often used or referenced in popular culture.
   </li>
     <li><strong>Somebody to love</strong> 
       The lyrics, especially combined with the gospel influence, create a song about faith, desperation and soul-searching; the singer questions both the lack of love experienced in his life, and the role and existence of God.
         </li>
   </ul>
    
          <p class="quote"> <em>...I feel good!
And no-one's gonna stop me now...</em> </p>
    
 </section>
 <p>
   <a id="tribute-link" class="link" href="https://en.wikipedia.org/wiki/Freddie_Mercury#Discography" target="_blank"> Check Freddy's Wikipedia for more info </a>
 </p>
 
</main>
</body>
</html>
/* file: styles.css */

html {
 font-size: 10px;
}
#main {
 text-align: center;
 color: #333;
 margin: 0;
 font-family: Helvetica
}

 h1 {
   padding: 40px;
   color: red;
   background-color: black;
 }
 h2 {
   padding: 10px;
   color: blue;
   height: 25px;
 }
 p {
   padding: 10px;
   max-width: 600px;
   margin: auto;
   text-align: justify;
 }
.quote {
   padding: 10px;
   color: blue;
   text-align: center;
   height: 20px;
}

ul {
 max-width: 600px;
 margin: 20px auto 20px auto;
 text-align: left;
 line-height: 1.5;
}

#image {
display: block;
max-width: 500px;
width: 100%;
height: auto;
margin: 0 auto;
min-width: 20px;
}
   img{
  max-width: 100%;
  display: block;
  margin: auto;
   }

#img-caption {
font-size: 12px;
}

   **Your browser information:**

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

Challenge: Build a Tribute Page

Link to the challenge:

Hi there!

Please note the hint given right at the end of the project assignment’s description:

Be sure to add <link rel="stylesheet" href="styles.css"> in your HTML to link your stylesheet and apply your CSS
1 Like

You also need to set the max-width of #image to 100% :

1 Like

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