Sort out the layout scheme ideas and layout scheme ideas
Previously, I wrote a blog Based on Netease's front-end micro-major courses.
Horizontal center plan
Vertical center Scheme
Horizontal and vertical center plan
At last, the teacher summarized the ideas proposed by the "solution ".
For example
Display: flex
Display: table
Display: inline-block
Display: table-cell
Vertical-align: middle
Justify-content: center
What are the characteristics of such attributes and values?
① Be sure to have a good grasp of these features.
② Then, the question is decomposed. For example, when we first talked about "horizontal center", the demand at the time was "the element width inside is not necessarily, and the element width outside is not necessarily ", then we can split this requirement into two parts,
Step 1: implement the elementsWidth follows content
Step 2: Achieve horizontal center
Css features and requirements.