当前第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居中怎么表示的详细内容,更多文章请关注木庄网络博客!
返回前面的内容
相关阅读 >>
javascript中怎么使用item方法
javascript怎么设置字体颜色
javascript中怎么换行
javascript可不可以跨平台
javascript创建对象的方法有哪些
javascript中的惰性求值是什么
哪个不属于javascript的特征
javascript如何将字符串转为数字
前端的基础知识巩固
javascript专题之一:变量提升与预编译
更多相关阅读请进入《javascript》频道 >>
人民邮电出版社
本书对 Vue.js 3 技术细节的分析非常可靠,对于需要深入理解 Vue.js 3 的用户会有很大的帮助。——尤雨溪,Vue.js作者
转载请注明出处:木庄网络博客 » javascript居中怎么表示