Learn Accessibility by Building a Quiz - Step 51

Tell us what’s happening:

why do i need to create a margin-right to auto, so it centers?

Your code so far

<!-- file: index.html -->

/* file: styles.css */
/* User Editable Region */

section {
  width: 80%;
  margin: 0
}


/* User Editable Region */

Your browser information:

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

Challenge Information:

Learn Accessibility by Building a Quiz - Step 51

Hi there!

If you want to margin something to center. You need to specify right and left margin auto. other wise you can give it any value as per your requirement.

Hello there, @wqfpeterallen1230906 welcome to fcc forum.

Answer to your question: Why do you need to use “auto”

By setting the value of “margin-right: to auto” you’re telling the browser to calculate the space needed to center the section and apply that much margin automatically everywhere.

Note: You need to use four margin property, one width property and a max-width property inside section element.

I hope my reply will help you, let me know thanks.

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