Not sure what I have to do satisfy these three:
(1) Your img element should have a display of block .
(2) Your #image should have a max-width of 100%.
(3) Image should be centered.
img {
display: block; /* Makes the image a block-level element */
max-width: 100%; /* Ensures the image doesn't exceed its parent's width */
height: auto; /* Maintains the image's aspect ratio */
margin-left: auto; /* Centers the image horizontally */
margin-right: auto; /* Centers the image horizontally */
}```
Please try one of the following steps to move forward.
Click on the “Reset” step button and force a refresh of your page with CTRL + F5 if you’re on Windows then try to paste the code in again. On other systems, please follow the instructions here.
or - Try the step in incognito or private mode.
or - Disable any/all extensions that interface with the freeCodeCamp website (such as Dark Mode, Ad Blockers, or Spellcheckers), and set your browser zoom level to 100%. Both of these factors can cause tests to fail erroneously.
or - Ensure your browser is up-to-date or try a different browser.
or - Turn off high contrast themes on Windows (from accessibility settings menu)
Hello, what helped you pass the tests? I have the same problem as you had, except that I found that when I run the tests in Chrome, the last (19th about centering the image) test works, but on the 16th and 17th (about the display of block and the max-width of 100%)
In the future, please create your own topic when you have specific questions about your own challenge code. Only respond to another thread when you want to provide help to the original poster of the other thread or have follow up questions concerning other replies given to the original poster.
The easiest way to create a topic for help with your own solution is to click the Ask for Help button located on each challenge. This will automatically import your code in a readable format and pull in the challenge url while still allowing you to ask any question about the challenge or your code.