This article is a mirror article of machine translation, please click here to jump to the original article.

View: 10406|Reply: 0

[CSS/DIV] html settings centered

[Copy link]
Posted on 6/30/2019 8:39:26 PM | | |


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.














Previous:Vultr VPS Hosting Panel General Management Graphic Guide covers basic VPS operations
Next:websocket question
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com