Home > front end >  web
web

Time:10-26

How to put him in the middle, center, good hard ah, CSS

CodePudding user response:

CSS
# container {
Width: 300 px;
Margin: auto;
}

CodePudding user response:

reference 1/f, three dozen soy sauce response:
CSS
# container {
Width: 300 px;
Margin: auto;
}

Width can be set to one hundred percent

CodePudding user response:

Set the 300 px into * * % 1-100

CodePudding user response:

Structure problem, generally divided into & lt; Header>

CodePudding user response:

Margin 0 autu

CodePudding user response:

Your class less centered "" don't make the same id and class names very many methods, give the container a width margin: 0 atuo, positioning can also, various

CodePudding user response:

1. The width of the fixed, usable margin: 0 auto; Or absolute positioning position: absolute; Left: 50%; Margin - left: - the login panel width/2;
2. The width, the available position: absolute; Left: 50%; The transform: translateX (50%); Or use the flex layout,