Css box margin

When user margin it work and looks good in mobile version but when switching to desktop version the box moved to left side of the screen…
I use: margin-left:10px; margin-right:10px;

But when I delete margin code it shows like this in attachment. How to we fix margin left & right?

Like this :.

The first image fix in screen but we like to add bit margin from left and right just like image two.

If you have a width or max-width on your container, you can use margin:auto; to center it on desktops.

It’s hard to give advice since you did not post a working example of the code your using.

1 Like

You can help us help you by posting a working page as requested

This sounds like an elementary HTML and CSS question (which @Ray.H has answered.)

Please take a beginning HTML and CSS course.

Problem has fixed… I corrected.

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