Tribute Page - Build a Tribute Page

Tell us what’s happening:
Describe your issue in detail here.
Hello guys, I’ve been stuck here for a while, kindly help.

Your code so far

<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>Wangari Maathai</title>
    <link rel="stylesheet" href="styles.css">
  </head>
  <body>
    <main id="main">
      <h1 id="title">Wangari Maathai</h1>
      <div id="img-div">
        <img id="image"></img>
        <figcaption id="img-caption">Mother Nature</figcaption>
        <a id="tribute-info">The first African woman to receive the Nobel Peace Prize</a>
        <p>For more info about<a id="tribute-link" target="_blank" href="https://wangarimaathai.com"> Wangari Maathai</a> click the link</p>
        <a href-"https://italiantrulli.com"><img src="pic_wangarimaathai.jpg" alt="Wangari Maathai" class="center"></a>
        <legend>
          Below is a biography of Wangari Maathai
          </legend>
          <h2>1940</h2>
          <p>-Born in Nyeri, Kenya</p>
          <h2>1964</h2>
          <p>She obtained her first degree in Biological Sciences from Mount St. Scholastica College in Atchison<p>
            <h2>1964</h2>
            <p>She obtained a Master of Science degree from the University of Pittsburgh</p>
            <h2>1971</h2>
            <p> Anatomy, University of Nairobi</p>
            <h2>1976</h2>
            <p>She introduced the idea of community-based tree planting</p>
            <h2>2005</h2>
            <p>She was appointed Goodwill Ambassador to the Congo Basin Forest Ecosystem by the eleven Heads of State in the Congo region</p>
            <h2>2011</h2>
            <p>Died at the age of 71</p>
      </div>
    </main>
  </body>
</html>
/* file: styles.css */
main {
  text-align: center;
  margin: 15px;
  display: block;
}
legend {
  margin: 1em auto;

}
h2, p {
  text-align: block;
  margin: 1em auto;
}
img {
  height: auto;
  display: block;
  max-width: 100%;
}
.center {
  display: block;
  margin-left: auto;
  margin-right: auto;
  width: 50%;
}
image {
  text-align: center;
}

Your browser information:

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

Challenge: Tribute Page - Build a Tribute Page

Link to the challenge:

Could you explain a little more about what you’re having difficulty with exactly please?
Your code passes all but one of the tests.
Your #image should be centred within the #img-div. That’s easy enough to do by adding the appropriate margin property to #image.

I’m a little confused why you have an #image element which isn’t an image however?

You have a separate img element further down…

… the href has a hyphen which is syntactically invalid. The reason the image won’t display though is that you can’t use locally stored image files for these projects. You’d need to link to it on an image hosting site (e.g. flickr).

I wouldn’t bother with a class of ‘center’ on your img element. You can just apply the appropriate CSS rules directly to the #image selector.

Now am lost :joy: :joy:…Would you mind to elaborate what exactly it is that I’m required to do kindly?

If you want to centre an element, a simple way do to so is:

element {
  display: block;
  margin: auto;
}

So, you can apply these rules to the #image or img selector in your CSS, instead of creating a separate .center selector and giving the element that class.

As for hosting the image, there are countless image hosting sites which you can sign up to for free and then host your images on. You then give the img element a src attribute with a url pointing to the image on the image hosting site.

My issue is with “hosting the image” would you mind to guide me please.?

I use https://www.flickr.com/ quite often. There are MANY other options however, so you may prefer some other site.

You sign up for a free account with the image hosting site. Then you upload your image to the site. It will then give you a url which you can set as the src for your img.

EXAMPLE (hosted on my flickr):
<img src="https://live.staticflickr.com/65535/50576392253_713a1b67b8_b.jpg" width="512" height="384" alt="Badger"/>
Badger

I’ve created an account… Now how do I get the image of the person I want as link?

Click on the upload button (top right):
Untitled

Then follow the steps on screen to upload the image.
Then go to your photostream (from the You menu) and click on the image you’ve uploaded.
Click on the share arrow (bottom right) and you’ll get a window like this:
Untitled
If you click on the Embed tab, you can then copy the html code in the box, which will look something like this:

<a data-flickr-embed="true" href="https://www.flickr.com/photos/27552610@N02/52960023685/in/dateposted-public/" title="IMG_20230525_163015__01"><img src="https://live.staticflickr.com/65535/52960023685_bfce8bbf8f_b.jpg" width="1024" height="985" alt="IMG_20230525_163015__01"/></a><script async src="//embedr.flickr.com/assets/client-code.js" charset="utf-8"></script>

The only bit you really need from this is the src attribute in the img element. So paste that bit into the src attribute of your img element and your image should now display.

So for me to upload the image in flickr it must be in my gallery or?

This is the src you currently have in your img element. So where is the file pic_wangarimaathai.jpg? Is it saved locally on your PC?

Forget about everything in my code…Now I’ve uploaded the image in flickr…how do I get the link.?

Please see the post above where I explain in detail how to do this.

Imgur
Is this the link or am I to expect another one?

Yes, now copy that link as the value for your src attribute in your img element and your image should display on your webpage.

Thank you very much. I really appreciate.

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