Home  >  Article  >  Web Front-end  >  我想让DIV居中对齐怎么修改???._html/css_WEB-ITnose

我想让DIV居中对齐怎么修改???._html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:16:341016browse

回复讨论(解决方案)

没有人么???上面的东西还要修改哪些地方才能让这个DIV显示在页面中间???

为什么要悬浮,把float:left去掉就可以了!

......
 试试

<!DOCTYPE html><html><head><style>* {margin:0px;padding:0px;}#page {margin-left:auto;margin-right:auto;}</style></head><body><div id="page">page</div></body></html>

把Css样式改成下面的,应该就可以了。

.Classpeng{    margin:0px auto;    text-align:center;    width:200px;    height:100px;}

3楼的你碉堡了!一换上就有效果了.
不过还是谢谢楼上的各位了.

Statement:
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