preface Some time ago, I took on a front-end project, wrote the company's official website, just a static website, and added a few dynamic effects. To be honest, when I first saw the website, I thought it was so easy. But when I wrote it, I found that the style exploded. The style is good on this browser, but it blows up on another, it's really scary. I will never take on things I am not good at in the future. This article sorts out the writing method of centering style.
Text
Below will record four centering writings
1 : positioning + translaste 2: Flex layout 3:inline-block 4: If you know the specific width and height, is there anything else you can't do???
Create a new html page, paste the following code into it, and double-click to run it:
Epilogue
Brain pain, in addition to centering, writing pages, there are some floating pits. Next time, I will also sort out the floating pits, such as the partition wall method, the inner wall method, the overflowhidden method, etc.
|