如何用Dreamweaver CS5让一个网页居中? 如何用dreamweaver cs5使页面居中对齐

\u600e\u4e48\u6837\u8ba9dreamweaver \u505a\u7684\u7f51\u9875\u6574\u4f53\u90fd\u5c45\u4e2d

\u3000\u3000\u628a\u7f51\u9875\u4e2d\u7684\u6574\u4f53\u5185\u5bb9\u7528\u4e00\u4e2a\u5bbd\u5ea6\u56fa\u5b9a\u7684div\u5305\u8d77\u6765\uff0c\u4e4b\u540e\u8bbe\u7f6emargin\u5de6\u548c\u53f3\u4e3aauto\u5373\u53ef\u3002
\u3000\u3000\u4ee3\u7801\uff1a
\u3000\u3000\u3000\u3000 \u7f51\u9875\u5185\u5bb9\u2026\u2026\u3000\u3000.wrap{ width:90%;margin:0 auto; }\u3000\u3000\u4e00\u822c\u7f51\u9875\u5c45\u4e2d\u90fd\u7528\u8fd9\u79cd\u65b9\u6cd5\uff0cclass\u540d\u5b57wrap\u53ef\u4ee5\u81ea\u5b9a\u4e49\u3002

\u7528\u9f20\u6807\u70b9\u51fb\u8868\u683c\u53f3\u8fb9\u7684\u6846\u8fb9\uff0c\u8868\u683c\u4e00\u5708\u88ab\u9009\u4e2d\u4e86\uff0c\u4e0b\u9762\u5c31\u662f\u8868\u683c\u7684\u5c5e\u6027\u9762\u677f\u4e86\uff0c\u5c31\u80fd\u8c03\u8868\u683c\u7684\u4f4d\u7f6e\u4e86

设置网页居中常见的两种方法:
第一种,设置div的宽度和margin属性。
如:
<body>
<div style="width:1000px; height:500px; margin:0 auto;padding:0;"></div>
</body>
这样就能让次DIV在屏幕中居中;

第二种方法:将屏幕分等分,即20%、80%、20%。将两边的颜色设置成透明即可。
<body>
<div style="width:20%; height:500px;"></div>
<div style="width:80%; height:500px;"></div>
<div style="width:20%; height:500px;"></div>
</body>
这样中间80%的DIV就能屏幕中居中。

如果是表格做的页面,那么就让最外围表格对齐方式:居中对齐。
如果是div做的,那么在css中设置相应div:margin-right: auto;margin-left: auto;

这个与你浏览器的选择和电脑的分辨率也有关系,最好的方法是设置两个div层,利用嵌套使用ps过的网页放在另外一个div层中设置属性居中,基本上这个问题就可以解决。

在Dreamweaver中的设计网页中 在下方设计的编辑中 点BODY 在点击网页的编辑中点居中就行了

<html>
<head>
<title>3_our tours</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
</style>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" style="background:url(图片路径) 50% 0 no-repeat">
<div id="body"></div>
</body>
</html>

扩展阅读:dreamware网页制作 ... dream weaver软件 ... dreamwearver手机版下载 ... adobe illustrator ... dreame扫地机器人app ... html+css网页制作成品 ... adobe dreamware ... dreamweaver手机版安装 ... dreamweaver免费版 ...

本站交流只代表网友个人观点,与本站立场无关
欢迎反馈与建议,请联系电邮
2024© 车视网