问题:
This question already has an answer here: 这个问题在这里已有答案:
- How to horizontally center a <div>? 如何水平居中<div>? 101 answers 101个答案
I have a div
tag with width
set to 800 pixels . 我有一个width
设置为800像素的div
标签。 When the browser width is greater than 800 pixels , it shouldn't stretch the div
, but it should bring it to the middle of the page. 当浏览器宽度大于800像素时 ,它不应该拉伸div
,但它应该将它带到页面的中间。
解决方案:
参考一: https://stackoom.com/question/409m/如何将-div-与页面的中间-水平-宽度-对齐-重复参考二: https://oldbug.net/q/409m/How-to-align-a-div-to-the-middle-horizontally-width-of-the-page-duplicate
来源:oschina
链接:https://my.oschina.net/u/4432649/blog/4327099