Problem with Center an Element Horizontally Using the margin Property

Tell us what’s happening:
Describe your issue in detail here.
Good day! im stuck! please help. the task says to center the div element using
"margin: auto; " which i have done. Unfotuntely its not runing and i have checked the help section and it seems that im right hence i dont know what to do.

  **Your code so far**

<style>
div {
  
  background-color: blue;
  height: 100px;
  width: 100px;
  margin: auto;
  
  
}
</style>
<div></div>
  **Your browser information:**

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

Challenge: Center an Element Horizontally Using the margin Property

Link to the challenge:

Ya, your code is correct. I copy/pasted it into the challenge and it passes just fine. Usually when the tests fail with CSS issues it’s because there is an extension installed in the browser that messes with the display and fools the test into thinking it is not working properly. So if you have any extensions installed that might be doing this (dark mode extensions, ad-blockers, etc…) then start disabling them one by one until you figure out which one is causing the issue.

If that doesn’t help then try a different browser, preferably a clean one without any extensions installed.

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