Trouble with CSS portion of tribute page

having trouble with CSS portion of tribute page
https://codepen.io/sarahtmasterson/pen/gOxeJjY - link to code pen

1 Like

Can you be specific about what the trouble is that you’re having?

I was having this same problem in my tribute page coding coding.

Hello - thanks for the reply. These are the items I have having trouble with:

The element should responsively resize, relative to the width of its parent element, without exceeding its original size.

and here is the other item I am having trouble with:

The element should be centered within its parent element.

Thanks for any feedback!

1 Like

The ‘max-width: 100%’ and ‘height: auto’ are for resizing the image. The ‘margin: auto’ and ‘display: block’ are for centering the image. You wouldn’t normally need ‘display: block’ though. I think that’s just needed here because you have the image wrapped in a figure tab. That’s my best guess anyway.

img {
  max-width: 100%;
  height: auto;
  margin: auto;
  display: block;
}

And by the way, that’s literally the only css I had in your css. I got rid of everything else. You didn’t need it.

2 Likes

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