阅读内容 

如何设定div层的对齐方式

[日期:2008-11-30] 来源:  作者: [字体: ]

在Dreamwaver中设计div层的时候,属性面板没有像表格一样给出水平、垂直对齐方式的选项,使用下面的代码可以做到:

<HTML>
<head>
<style. type="text/CSS">
<!--
div{
 border:1px solid #000000;
 text-align:center;
 padding-top:expression(parseInt(this.style.height)/2-parseInt(this.childNodes(0).scrollHeight)/2);

}
//-->
</style>
</head>
<body>
请将 图片(可多张) 或 其它内容 插入&lt;span&gt;&lt;/span&gt;标签中<br>
<div style="width:200px;height:200px">
 <span>
  <img src="http://webyi.com/images/common/XML.gif"><br>
  <img src="http://webyi.com/images/common/xml.gif"><br>
  <img src="http://webyi.com/images/common/xml.gif">
 </span>
</div>
<P>
<div style="width:200px;height:200px">
 <span>
  <img src="http://www.baidu.com/img/LOGO.gif"/>
 </span>
</div>
<P>
<div style="width:200px;height:200px">
 <span>
  asddsf
 </span>
</div>
<P>
</body>
</html>

阅读:
录入:blue1000

推荐 】 【 打印
相关新闻      
本文评论       全部评论
发表评论
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款


点评: 字数
姓名:
Advertisement
内容查询


Advertisement