Home > front end >  CSS margin: 0 auto; Don't display
CSS margin: 0 auto; Don't display

Time:09-22

Figure 1 is the CSS code

Figure 2 is the HTML code

Figure 3 is a browser to open the screenshot


Why the margin: 0 auto; Don't work, can't center??????


CodePudding user response:

Written style, no problem, you are not in the HTML reference style address is wrong, not loaded into the page style, F12 debugged

CodePudding user response:

Don't save? Right click to view the current CSS styles

CodePudding user response:

refer to the second floor jio can reply:
didn't save? Right click to view the current CSS style


If didn't save the background image cannot be displayed

CodePudding user response:

Give the body full width

CodePudding user response:

reference 4 o f old beam response:
give body hundred wide

Set the CSS class of the body?

CodePudding user response:

reference 5 floor Elegent_wei_IT reply:
Quote: reference 4 o f old beam response:

To body hundred wide

Set the CSS class of the body?

of

CodePudding user response:

Div id="all", this div will give width, box to center must specify the width, you are now to his child element box nav width didn't give all width

CodePudding user response:


Try using a negative number,

CodePudding user response:

Your problem is: CSS margin: 0 auto; Pictures for will show not center?
Answer: background - the image is wrong!!!!! Should be changed to:
# nav {
Background: url (picture/bg. JPG);
Width: 980 px;
Height: 627 px;
}
  • Related