Tribute Page - Build a Tribute Page

Tell us what’s happening:
Describe your issue in detail here.
how can I center my #img to it parent
Your code so far

<!-- file: index.html -->
<link rel="stylesheet" href="styles.css">
<main id="main"></main>
<h1 id="title">Learning coding is fun<h1>
  <div id="img-div" src="https://www.bing.com/images/search?view=detailV2&ccid=Uludis6h&id=D35ACD44F981365C62455732D1C556E80E7D6CBD&thid=OIP.Uludis6hluCFpFN-Z1kTowHaEg&mediaurl=https%3a%2f%2f2.bp.blogspot.com%2f-a1PgGOrpjMg%2fVO6jTnEOe1I%2fAAAAAAAADYU%2fiYGCX5jpcew%2fs1600%2f330-Kids%252BToys%252BHD%252BWallpaperz.jpg&cdnurl=https%3a%2f%2fth.bing.com%2fth%2fid%2fR.525b9d8acea196e085a4537e675913a3%3frik%3dvWx9DuhWxdEyVw%26pid%3dImgRaw%26r%3d0&exph=974&expw=1600&q=kid+toys&simid=608034500550201762&FORM=IRPRST&ck=89C2F6EDAA7A19E8635470C99D444086&selectedIndex=10&ajaxhist=0&ajaxserp=0">
    <img id="image">
    <figcaption id="img-caption">Loading...</figcaption>
  </div>
  <tribute id="tribute-info">i am a web developer.</tribute>
  <a id="tribute-link" href="#" target="_blank">i am a web developer.</a>
/* file: styles.css */
img{
  display: block;
  max-width: 100%;

}
#img-div{
  display: flex;
  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/108.0.0.0 Safari/537.36

Challenge: Tribute Page - Build a Tribute Page

Link to the challenge:

You have a couple of issues

That div should not have a src attribute. Remember that src attributes should be for the img element.

You should use the actual image address here so it will display correctly

Use this

https://2.bp.blogspot.com/-a1PgGOrpjMg/VO6jTnEOe1I/AAAAAAAADYU/iYGCX5jpcew/s1600/330-Kids%2BToys%2BHD%2BWallpaperz.jpg

Tribute is not a valid HTML tag.
You will need to use another HTML element there instead.

I would suggest setting the direction of elements to column and that will help with your centering issue.

Hope that helps :+1:

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