Home > front end >  What is the most efficient writing CSS vertically centered?
What is the most efficient writing CSS vertically centered?

Time:11-28

Application background: in the vue component in the manipulation of the component b input TAB, users fill in the content of the style, in alignment, a click on the user to fill in the component b of the text information depend on,

Is not vertical - algin properties, tried not to use,
Ask for advice

CodePudding user response:

Flex layout you're worth it

CodePudding user response:

If the layout is simple margin: auto is one of the simplest, but sometimes there are limitations
So use most should be the flex elastic box layout, or use the positioning is set after positioning properties left (50%), and then the transform: translateX (50%); Center, vertical in the same way, it is suggested that several methods should be skilled, center is too common

CodePudding user response:

refer to the second floor sha worm agent reply:
if layout is simple margin: auto is one of the simplest, but sometimes there are limitations
So use most should be the flex elastic box layout, or use the positioning is set after positioning properties left (50%), and then the transform: translateX (50%); Is centered, vertical in the same way, it is suggested that several ways are skilled, centered too common
my objective is: achieve similar functions to the inside of the form, click on the vertical or vertical center button, text input box will therefore change, I after the realization of the horizontal direction is to obtain the Dom style.css. TextAlgin set to center/left/right, but I don't know what to control vertical property change the layout, really like you said of that kind of at least two attributes control

CodePudding user response:

Flex layout, can see my latest blog, has said
  • Related