Tribute Page - Build a Tribute Page

Tell us what’s happening:
Describe your issue in detail here.
I am working on a tribute page as a certification project. In the header I put an image and an image caption. The caption had an “id=img-caption”. I gave the header a black color background. Thus the background of the caption is currently black. Now, I am unable to give the caption a white color. My code is:

#img-caption {

color: #dfdfe2;


Why the white color doesn’t appear?

Thank you.

  **Your code so far**
/* file: index.html */
<!DOCTYPE html>
<html lang="en>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Tribute page</title>
<link rel="stylesheet" href="styles.css" />
      <h1 id="title">Naguib Mahfouz</h1>
      <h2>A gient Egyptian writer</h2>
      <div id="img-div" style="width: image width px; text-align: center; font-size: 80%";">
      <img id="image" src="" alt="alternate text" width="width" height="height" style="padding-bottom: 0.5em;"/>
      <caption id="img-caption">The funeral of Naguib Mahouz atteded by the President, the prime minister,the parliament speader, the minister of defence and all other ministers</caption>
    <main id="main">
      <fieldset id="tribute-info">
        <legend>Basic features of his life</legend>
    <li>He was born in Dec. 11, 1911</li>
    <li>He studied philosophy at Cairo University,Egypt. After graduation he started working towards a Masters degree in Philosophy,then changed his mind deciding to be a professional writer  </li>
    <li>He published his first novel in 1939 and over a 70-year career he published 34 novels, more than 350 short stories, dozens of movie scripts and 5 plays</li> 
    <li>His work is generally classified as realist, but he wrote a number of existential novels, and has covered a broad range of topics, including the controversial and taboo such as socialism, homosexuality, and God</li>
    <li>One of his best-known works, The Children of the Alley, portrayed the patriarch Gebelaawi and his children, who were depicted living the lives of Cain and Abel, Moses, Jesus and Mohammed</li>
    <li>He was accused of blasphemy as this was considered as allegorical portrayal of God and the book was banned. When it was published Lebanon after more than 7 years it was prohibited from distribution in Egypt. Its first print in Egypt was his death</li>
    <li>Most of his writings deal mainly with politics. He espoused Egyptian Nationalism in many of his works and was sympathetic for socialism and democracy with antipathy towards Islamic extremism</li>
    <li>Disillusioned with the 1952 revolution he just supported its principles but realized later that it failed to live up to the original ideals</li>
    <li>In his novel The Thief and Dogs (1961) he depicted the fate of a Marxist thief and in his Tharthara Fawq Al-Nīl (Adrift on the Nile) (1966) he criticized the decadence of Egyptian society during the Nasser era. Then, in his Miramar (1967) he described a Socialist and a Nasserite opportunist</li>
    <li>He was awarded the 1988 Nobel Prize in Literature, the only Arab writer to have won the award</li>
    <li>As he supported Sadat's Camp David Peace Treaty with Israel in 1978, his books were banned in many Arab countries until after he won the Nobel Prize</li>
    <li>He believed in freedom of expression and, although he did not agree with Salman Rushdie’s work of The Satanic Verses seeing it as insulting to Islam, he spoke out against the fatwa of Ayatollah Khomeini  that condemned Rushdie to death for it.</li>
    <li>In 1989, he joined 80 other intellectuals in declaring that "no blasphemy harms Islam and Muslims so much as the call for murdering a writer."</li>
    <li>He was on an Islamic fundamentalist "death list" and In 1994 an extremist succeeded in stabbing him in the neck outside his Cairo home</li>
    <li>He survived the attack but was permanently affected by damage to nerves of his right upper limb and was unable to write for more than a few minutes a day</li>
    <li>He was awarded highest honors in Egypt, and was awarded high honors in Chili, France, Italy, and Tunisia</li>
        <fieldset id="tribute-link" target="-blank">
        <legend>For more information about Mahfouz visit</legend>
        <a href="">Naguib Mahfouz</a>
/* file: styles.css */
header {
background-color: black;
#title , h2{
text-align: center;
img {
width: 100%;
position: centered; 
#img-caption {
color: #dfdfe2;
#main {
padding-top: 15px;
#tribute-info > ul > li{
padding-top: 5px;  
fieldset {
border: transparent;
legend {
color: rgb(0,0,255);
  **Your browser information:**

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

Challenge: Tribute Page - Build a Tribute Page

Link to the challenge:

Hello, this is from the w3schools website:

Definition and Usage
The <caption> tag defines a table caption.

The <caption> tag must be inserted immediately after the <table> tag.

You are not using a table, so why are you using the <caption> element? Instead, change it to <div> and it will work. Or other more appropriate if needed.

Yes, you are right. I changed it to div and it worked.
Thank you very much.

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