Build a Product Landing Page: Img won't get resized

Tell us what’s happening:
Describe your issue in detail here.

Hi there, I was wondering if anyone can help. I am new into coding, I have been studying Responsive Web Design and right now I am trying to create a Product Landing Page, and I’ve tried first of all to add a logo on my page.

So the HTML bit is okay, all working fine. However, I’ve been trying to resize my image using CSS, and it seems like it’s not picking the code up.

I have tried removing adblocks, refreshing the page, deleting cache&cookies, nothing worked.

I have tried deleting the id of my img element, didn’t work. I have tried replacing max-width to width and even min-width, just to see what kind of response I would get, but nothing.

To mention, I have created a pen on and inserted the exact same code and it’s all working fine. It seems there is an issue with my code only when written on freecodecamp.

Any ideas on how I could make this work?


  **Your code so far**
\ file: <!DOCTYPE html>
    <header id="header">
      <img id="header-img" src="" alt="Milwakee logo"></img>
\ file: #header-img {
max-width: 150px;
display: block;
height: auto;
  **Your browser information:**

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

Challenge: Build a Product Landing Page

Link to the challenge:

I think you forgot to reference the stylesheet in your HTML as noted under the User Stories. No CSS will work until then, they need to be linked.

Note: Be sure to add <link rel="stylesheet" href="styles.css"> in your HTML to link your stylesheet and apply your CSS

Hi, sorry for the late reply, I’ve been away with no access to my computer. I’ve tried it now, and it works. I didn’t know I’d have to add that in my HTML, thanks a lot!

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