我有一个div在我的HTML页面。我基于某些条件显示这个div,但是div显示在我指向鼠标光标的HTML元素后面。
我已经尝试了z-index从0到999999的所有值。有人能告诉我为什么会这样吗?
CSS的Z-INDEX属性是否有最小值或最大值?
.divClass {
位置:绝对的;
左:25 px;
上图:25 px;
宽度:320 px;
身高:300 px;
z - index: 1000;
}
<table cellspacing="0" cellpadding="0" width="100%">
< tr >
< td >
<asp:HyperLink ID="lnkProgram" runat="server"></asp:HyperLink>
< / td >
< / tr >
< tr >
< td >
< div class = " divClass”>
一些数据
< / div >
< / td >
< / tr >
表> < /
我显示和隐藏div与. divclass onclick通过<asp:超链接>使用jQuery。
http://www.w3.org/TR/CSS21/visuren.html#z-index
“z - index”
取值范围:auto | <integer> | inherit
http://www.w3.org/TR/CSS21/syndata.html#numbers
Some value types may have integer
values (denoted by <integer>) or
real number values (denoted by
<number>). Real numbers and
integers are specified in decimal
notation only. An <integer>
consists of one or more digits "0" to
"9". A <number> can either be an
<integer>, or it can be zero or
more digits followed by a dot (.)
followed by one or more digits. Both
integers and real numbers may be
preceded by a "-" or "+" to indicate
the sign. -0 is equivalent to 0 and is
not a negative number.
Note that many properties that allow
an integer or real number as a value
actually restrict the value to some
range, often to a non-negative value.
所以基本上在CSS标准中没有对z-index值的限制,但我猜大多数浏览器在实践中将其限制为带符号的32位值(−2147483648到+2147483647)(64会有点超出顶部,而且现在使用任何低于32位的值都没有意义)