table标签的style里有一个z-index是什么作用?
请问<table style="Z-INDEX: 101; LEFT: 176px; POSITION: absolute; TOP: 144px">
里Z-INDEX:101和POSITION:absolute分别是什么意思呢?
谢谢!
POSITION:absolute------在二维平面上的绝对定位
Z-INDEX:101---------------在三维空间中靠前还是靠后的位置
都是英文:
z-index: z轴顺序。z-index 较大的元素处于上层。
position: 位置
absolute: 绝对
POSITION:absolute 这个是绝对定位!前面那个是设置显示的次序。值越大越先现实。盖住值较小的元素。不知道table支持不。没用到table上过,层上用过。。
谢谢了,简单说一个三维,一个2D,谢谢大家了!
table,div都是块元素
table当然可以实现POSITION:absolute 与Z-INDEX,请看例子
[html]
<table border="1" style="width:120;height:240;background-color:red;position:absolute;top:10;left:10;z-index:-100;"><tr><td>table1</td></tr></table>
<table border="1" style="width:120;height:240;background-color:green;position:absolute;top:60;left:60;z-index:100;"><tr><td>table2</td></tr></table>
<div style="width:120;height:240;background-color:cyan;position:absolute;top:10;left:300;z-index:-100;">div1</div>
<div style="width:120;height:240;background-color:gold;position:absolute;top:60;left:350;z-index:100;">div2</div>
[/html]
请问<table style="Z-INDEX: 101; LEFT: 176px; POSITION: absolute; TOP: 144px">
里Z-INDEX:101和POSITION:absolute分别是什么意思呢?
谢谢!
POSITION:absolute------在二维平面上的绝对定位
Z-INDEX:101---------------在三维空间中靠前还是靠后的位置
都是英文:
z-index: z轴顺序。z-index 较大的元素处于上层。
position: 位置
absolute: 绝对
POSITION:absolute 这个是绝对定位!前面那个是设置显示的次序。值越大越先现实。盖住值较小的元素。不知道table支持不。没用到table上过,层上用过。。
谢谢了,简单说一个三维,一个2D,谢谢大家了!
table,div都是块元素
table当然可以实现POSITION:absolute 与Z-INDEX,请看例子
[html]
<table border="1" style="width:120;height:240;background-color:red;position:absolute;top:10;left:10;z-index:-100;"><tr><td>table1</td></tr></table>
<table border="1" style="width:120;height:240;background-color:green;position:absolute;top:60;left:60;z-index:100;"><tr><td>table2</td></tr></table>
<div style="width:120;height:240;background-color:cyan;position:absolute;top:10;left:300;z-index:-100;">div1</div>
<div style="width:120;height:240;background-color:gold;position:absolute;top:60;left:350;z-index:100;">div2</div>
[/html]