CSS : centering a div and mixing pixels and percents

帅比萌擦擦* 提交于 2019-12-13 05:39:15

问题


I would like to have a <div> centered in my page, with width = a % + b pixels.

Does anyone know how to do it ?


回答1:


You can give its parent div, align="center" like:

<div align="center">
   content
</div> 


来源:https://stackoverflow.com/questions/13230107/css-centering-a-div-and-mixing-pixels-and-percents

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!