They keep telling me ** You should have a figcaption
or div
element with an id
of img-caption
.us what’s happening:**
How should I go about this
Your code so far
<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="styles.css">
</head>
<main id="main">
<title id="title" >Dr Norman Borlaug</title>
<div id="main">
<div id="img-div" display="block" >
<img id="image" src="example.jpg" alt="Example Image">
<p id="img-caption">Example Image Caption</p>
</div>
<div id="tribute-info">Example Tribute Info</div>
<a id="tribute-link" href="#" target="_blank" >Example Tribute Link</a>
<figure>
<img src="your-image-url" alt="your-image-description">
</figure>
<div id="img-caption">This is a caption for the image</div>
</div>
<figcaption id='img-caption'>The man who saved a billion lives</figcaption>
</div>
</main>
/* file: styles.css */
.parent {
display: flex;
justify-content: center;
align-items: center;
height: 500px;
}
.responsive-image {
max-width: 100%;
max-height: 100%;
width: auto;
height: auto;
}
img {
display: block;
margin: auto;
max-width: 100%;
}
#img-caption {
font-style: italic;
text-align: center;
padding: 10px;
}
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36
Challenge: Tribute Page - Build a Tribute Page
Link to the challenge:
hbar1st
February 13, 2023, 11:46am
2
Marc_Krys:
<p id="img-caption">
This is a p element with id img-caption
Delete all the duplicate ids in your code.
Ids need to be unique.
Marc_Krys:
Its not working, I have deleted all duplicate ids
hbar1st
February 13, 2023, 2:13pm
4
please post the new code. In your original code, you had multiple duplicate ids (not just the one I showed you)
hbar1st
February 23, 2023, 9:02am
6
You still have multiple elements that use the same id.
You must make the id unique and used only in one element.
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="styles.css">
</head>
<main id="main">
<title id="title" >Dr Norman Borlaug</title>
<div id="main">
<div id="img-div" display="block" >
<img id="image" src="example.jpg" alt="Example Image">
<p id="img-caption">Example Image Caption</p>
</div>
<div id="tribute-info">Example Tribute Info</div>
<a id="tribute-link" href="#" target="_blank" >Example Tribute Link</a>
<figure>
<img src="your-image-url" alt="your-image-description">
</figure>
</div>
</main>
Duplicate id has been removed
hbar1st
February 23, 2023, 12:24pm
8
I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor (</>
) to add backticks around text.
See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').
hbar1st
February 23, 2023, 12:26pm
9
You need to create an element, either a div or a fig caption, and give it the requested id.
Your last code has the wrong element
Marc_Krys:
<p id="img-caption">
This is a p element so it does not satisfy the requirements
system
Closed
August 25, 2023, 12:27am
10
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.