当前第2页 返回上一页
Div上下居中代码
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<title>Div上下居中-www.51windows.Net</title>
<head>
<meta name= "keywords" content= "51windows.Net" >
<meta http-equiv=content-type content= "text/html; charset=gb2312" >
</head>
<body>
<div style= "position: absolute; top: 200; left: 0; width: 300; height: 200;border: 1 solid #C0C0C0;" >
<div style= "border: 1 solid red;position: absolute;top:expression((this.parentElement.offsetHeight-this.offsetHeight)/2);left:expression((this.parentElement.offsetWidth-this.offsetWidth)/2);" >我站在中央了
center</div>
</div>
<div style= "border: 1 solid #C0C0C0;" >
<div style= "border: 1 solid red;position: absolute;top:expression((this.parentElement.offsetHeight-this.offsetHeight)/2);left:expression((this.parentElement.offsetWidth-this.offsetWidth)/2);" >我站在中央了
center</div>
</div>
</body>
</html>
|
【相关推荐:javascript高级教程】
以上就是javascript居中怎么表示的详细内容,更多文章请关注木庄网络博客!
返回前面的内容
相关阅读 >>
js中object.defineproperty的用法介绍(代码示例)
js中遍历对象属性的方法介绍
javascript是由那几个部分组成
javascript bom 有什么用
javascript中table怎么删除行
javascript添加事件的三种方式
javascript数组排序方法是什么
javascript怎么实现二维码
javascript怎么开启
javascript作用域分为哪两类
更多相关阅读请进入《javascript》频道 >>
人民邮电出版社
本书对 Vue.js 3 技术细节的分析非常可靠,对于需要深入理解 Vue.js 3 的用户会有很大的帮助。——尤雨溪,Vue.js作者
转载请注明出处:木庄网络博客 » javascript居中怎么表示