“Pr pos z index”的版本间差异
本页内容
(创建页面,内容为“{{DISPLAYTITLE:z-index}}11 = CSS z-index 属性 = 设置图像的 z-index: <sample title="" desc="" lang="html" hererun="1"> img { position:absolute; left:0px; top:0px; z-index:-1; } </sample> <run name=""> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>小白教程(xiaobai.wang)</title> <style> img { position:absolute; left:0px; top:0px; z-index:-1; } </style> </head> <body> <h1>Th…”) |
无编辑摘要 |
||
(未显示同一用户的1个中间版本) | |||
第1行: | 第1行: | ||
{{DISPLAYTITLE:z-index}}[[Category:css | {{DISPLAYTITLE:z-index}}[[Category:css reference|171]] | ||
= CSS z-index 属性 = | = CSS z-index 属性 = | ||
第63行: | 第63行: | ||
{| class="table table-striped table-hover" | {| class="table table-striped table-hover" | ||
! 属性 | ! 属性 | ||
! | ! Chrome | ||
! | ! Internet Explorer / Edge | ||
! | ! Firefox | ||
! | ! Safari | ||
! | ! Opera | ||
|- | |- | ||
| z-index | | z-index |
2022年8月19日 (五) 04:47的最新版本
CSS z-index 属性
设置图像的 z-index:
示例
img
{
position:absolute;
left:0px;
top:0px;
z-index:-1;
}
属性定义及使用说明
z-index 属性指定一个元素的堆叠顺序。
拥有更高堆叠顺序的元素总是会处于堆叠顺序较低的元素的前面。
注意: z-index 进行定位元素(position:absolute, position:relative, or position:fixed)。
默认值: | auto |
继承: | no |
版本: | CSS2 |
JavaScript 语法: | object.style.zIndex="1" |
浏览器支持
表格中的数字表示支持该属性的第一个浏览器版本号。
属性 | Chrome | Internet Explorer / Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
z-index | 1.0 | 4.0 | 3.0 | 1.0 | 4.0 |
属性值
值 | 描述 |
---|---|
auto | 默认。堆叠顺序与父元素相等。 |
number | 设置元素的堆叠顺序。 |
inherit | 规定应该从父元素继承 z-index 属性的值。 |
相关文章
CSS 教程: CSS 定位