Home >Web Front-end >HTML Tutorial >Summary of points to note about front-end performance
The question of how to vertically center an element in css is already a commonplace question. Whether it is a newbie or a veteran, this question is often asked during the interview process. I was watching a flex video tutorial two days ago, and it mentioned the centering of elements, so today I will take a look at some common methods. Please criticize and correct any shortcomings (all the codes are typed by myself and available) 1. Horizontal centering (margin: 0 auto;) Regarding this, everyone should be the least familiar with it, whether it is in a training class or self-study if. This should be the first method taught by the teacher (horizontally), but it has a premise that the wrapped elements cannot have floating attributes. Otherwise, this attribute will become invalid. The specific code is as follows: