Home > front end >  CSS styles, web
CSS styles, web

Time:10-24

Its position is how to realize, always don't understand, is there any absolute positioning, such as in Java directly set coordinates, add each component is always on the left, how to let him in the middle and seek a general direction

CodePudding user response:

Look at the margin, padding, the position

CodePudding user response:

Suggest see div centered focus method, there is a use of positioning, and then locate several methods also have a look

CodePudding user response:

refer to the second floor jackZzzzzz response:
advice see div centered focus method, there is a use of positioning, and then locate several methods also have a look at

Can be set in the middle? Which one

CodePudding user response:

reference weixin_44968695 reply: 3/f
Quote: refer to the second floor jackZzzzzz response:
advice see div centered focus method, there is a use of positioning, and then locate several methods also have a look at

Can be set in the middle? Which one is

Center block element itself: set a fixed width for the element, and set up the margin: 0 auto;
Let the elements within the text centered: text - align: center;

CodePudding user response:

Centered approach is very much also, margin, postion of various, not sure about the size of the div, can locate plunged, left50, then move through the range of attribute set, to achieve in the results

CodePudding user response:

Text centered text - align: center;
Box level center margin: 0 auto; Width of box model with
Horizontal center positioning box left: top 50% : 50% transform: translate (50% - 50%);
Elastic box center display: flex; justify-content: center;
Elastic box vertical center align - content;
Under the specific usage and details the best I can go to the