Tell us what’s happening:
I am trying to make my image responsive in width relative to its parent in the way I learnt in the challenge about image responsiveness, but it won’t work.
Your code so far
<!DOCTYPE html>
<html>
<head>
<meta charset= utf-8>
<title id="title"> My Parents </title>
</head>
<body>
<main id=main>
<div id="img-div">
<figure>
<img id="image" src="https://images-na.ssl-images-amazon.com/images/I/61De6r9JAEL._AC_SX522_.jpg" alt="I love my Parents">
<figcaption id="img-caption">I love my mom and dad!</figcaption>
</figure>
</div>
<p id="tribute-info"> Throughout my whole life my parents have supported me and backed me up everytime I needed it. Throughout my almost 15 years of life they have never given up on me regardless of how many times I mess up, and that is a debt I can never repay. Whatever I needed was provided, and so was everything I wanted for that matter.</p>
<a id="tribute-link" href="https://www.familylives.org.uk/advice/primary/learning-school/supporting-your-child-at-school/" target=_blank> Click here to find out what parental support can help with.</a>
<style>
#img-div {
position: absolute;
justify-content: center;
}
figure {
justify-content: center;
}
#image {
width: 100%;
height: auto;
justify-self: center;
}
#img-caption {
position: relative;
top: 500px;
left: 200px;
color: black;
}
#tribute-info {
position: relative;
top: 500px;
left: 50px;
}
a {
position: relative;
left: 50px;
top: 500px;
}
body {
justify-content: flex-start;
}
</style>
</main>
</body>
</html>
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36
.
Challenge: Build a Tribute Page
Link to the challenge: