如何将<div>与页面的中间(水平/宽度)对齐[重复]
问题: 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