div+css 中宽度不明水平居中

WBOY
Release: 2016-06-20 12:36:48
Original
787 people have browsed it

在css中设置了text-align:center 和margin:0 auto;但还是不能水平居中,
整体宽度不明,有背景,背景能延生的那种
  急!急!急!急!


回复讨论(解决方案)

页面代码贴出来

宽度不明你就写100%

div{margin: 0 auto;width:100%;}

谢谢,各位。已解决。用了相对定位

谢谢,各位。已解决。用了相对定位



解决了就结贴吧

给div设置width,否则默认宽100%,看不出居中效果

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!