页面缩小,如何让内容全部居中??? 本帖最后由 agrxl 于 2014-09-07 21:42:34 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 那是因为你的页面默认是居左的,与缩小没关。参考下:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title> New Document </title> <style type="text/css"> body{ text-align:center; } .main{ width:1024px; height:1024px; background:#FF0000; margin:0px auto 0px auto; } </style> </head> <body> <div class="main"></div> </body></html> 定义margin:0 auto;可以实现左右居中 楼上正解 将div设置margin:0 auto; 如下代码怎么modify? php实现视频新闻播放 表单的提交 急求,如何获得网页中的文本框的内容 !!! 正则问题,急用,大家帮帮忙啊 怎样计算多维数组每一维的数量 很简单的问题,请帮帮忙 win2003下装PHP4的方法,详细点 PHP在win平台下面的session问题?!(急救) 为什么下面的这段上传文件的程序在本机能用,上传到服务器后就不能用?!急呀!!!!! 老话题了,不得不再问一下include和require 我们在建数据库时,设计表的字段为不为空的作用是什么?
参考下:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title> New Document </title>
<style type="text/css">
body{
text-align:center;
}
.main{
width:1024px;
height:1024px;
background:#FF0000;
margin:0px auto 0px auto;
}
</style>
</head> <body>
<div class="main"></div>
</body>
</html>