IE11 not recognizing z-index: -1
I have a table that uses box-shadow when hovering on rows to display some styling. This was working fine until I discovered that in IE11 it not working.
The problem seems to be that using a z-index: -1 to avoid the td being above tr is not working as expected in IE11.
table td
position:relative;
background-color: #EFEFEF;
z-index: -1;
I have created a fiddle that works in chrome but not in IE11: https://jsfiddle.net/pjz43a52/8/
So my questions are:
- Is there any known issue with IE11 and z-index: -1? I found things related to z-index but not to this case specifically.
- How can I solve this? I tried different things but none of them working without breaking the current behavior which is to have the box-shadow on top of the td.
Any ideas?
css internet-explorer-11 z-index box-shadow
add a comment |
I have a table that uses box-shadow when hovering on rows to display some styling. This was working fine until I discovered that in IE11 it not working.
The problem seems to be that using a z-index: -1 to avoid the td being above tr is not working as expected in IE11.
table td
position:relative;
background-color: #EFEFEF;
z-index: -1;
I have created a fiddle that works in chrome but not in IE11: https://jsfiddle.net/pjz43a52/8/
So my questions are:
- Is there any known issue with IE11 and z-index: -1? I found things related to z-index but not to this case specifically.
- How can I solve this? I tried different things but none of them working without breaking the current behavior which is to have the box-shadow on top of the td.
Any ideas?
css internet-explorer-11 z-index box-shadow
add a comment |
I have a table that uses box-shadow when hovering on rows to display some styling. This was working fine until I discovered that in IE11 it not working.
The problem seems to be that using a z-index: -1 to avoid the td being above tr is not working as expected in IE11.
table td
position:relative;
background-color: #EFEFEF;
z-index: -1;
I have created a fiddle that works in chrome but not in IE11: https://jsfiddle.net/pjz43a52/8/
So my questions are:
- Is there any known issue with IE11 and z-index: -1? I found things related to z-index but not to this case specifically.
- How can I solve this? I tried different things but none of them working without breaking the current behavior which is to have the box-shadow on top of the td.
Any ideas?
css internet-explorer-11 z-index box-shadow
I have a table that uses box-shadow when hovering on rows to display some styling. This was working fine until I discovered that in IE11 it not working.
The problem seems to be that using a z-index: -1 to avoid the td being above tr is not working as expected in IE11.
table td
position:relative;
background-color: #EFEFEF;
z-index: -1;
I have created a fiddle that works in chrome but not in IE11: https://jsfiddle.net/pjz43a52/8/
So my questions are:
- Is there any known issue with IE11 and z-index: -1? I found things related to z-index but not to this case specifically.
- How can I solve this? I tried different things but none of them working without breaking the current behavior which is to have the box-shadow on top of the td.
Any ideas?
css internet-explorer-11 z-index box-shadow
css internet-explorer-11 z-index box-shadow
asked Nov 10 at 2:37
Pablo Matias Gomez
3,59942256
3,59942256
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
<table>
is cancer...
Although I don't know WHY exactly such behaviors happen... But yeah - that's compatibility issues and we've to hack around it, so if we re-use the same code you wrote before, but instead of using a <table>
we will use only <div>
, the result will be the same, but it will work on IE11 - I tested it for you!
.container
background-color: #fafafa;
z-index: 0;
.table
position: relative;
width: 100px;
z-index: 1;
border-spacing: 0px;
border-bottom: 1px solid black;
.table .col
position:relative;
background-color: #EFEFEF;
z-index: -1;
border-top: 1px solid black;
border-right: 1px solid black;
border-left: 1px solid black;
.table .row:hover
position: relative;
box-shadow:
inset 5px 0 0 #dadce0,
inset -3px 0 0 #dadce0,
0 5px 2px 0 rgba(60,64,67,.3),
0 5px 3px 1px rgba(60,64,67,.15);
<div class="container">
<div class="table">
<div class="row">
<div class="col">Some Value</div>
</div>
<div class="row">
<div class="col">Some Value</div>
</div>
<div class="row">
<div class="col">Some Value</div>
</div>
</div>
</div>
add a comment |
Since you are setting the Z-Index property, when you using F12 developer tools (using IE 11) to select the elements, you can only select the table elements, instead of the tr, so, it will not trigger the hover action. Screenshot as below:
To solve this issue, you could add the following CSS style:
table tr
display:block;
Then, when using F12 developer tools to select elements, we could select the table row. Thus, it will trigger the hover action.
The test sample as below:
<style type="text/css">
table
position: relative;
z-index: 1;
border-spacing: 0px;
border-bottom: 1px solid black;
table td
border-top: 1px solid black;
border-right: 1px solid black;
border-left: 1px solid black;
table tr
display:block;
.container
background-color: #fafafa;
z-index: 0;
table td
position: relative;
background-color: #EFEFEF;
z-index: -1;
table tr:hover
position: relative;
box-shadow: inset 5px 0 0 #dadce0, inset -3px 0 0 #dadce0, 0 5px 2px 0 rgba(60,64,67,.3), 0 5px 3px 1px rgba(60,64,67,.15);
</style>
<div class="container">
<table>
<tbody>
<tr>
<td>Some Value</td>
</tr>
<tr>
<td>Some Value</td>
</tr>
<tr>
<td>Some Value</td>
</tr>
</tbody>
</table>
</div>
The result:
add a comment |
Is there any known issue with IE11 and z-index: -1?
This is likely not related to z-index directly, but due to the fact that CSS 2.1 specified that,
The effect of
position:relative
on table-row-group, table-header-group, table-footer-group, table-row, table-column-group, table-column, table-cell, and table-caption elements is undefined. (https://www.w3.org/TR/CSS2/visuren.html#propdef-position)
This restriction has been lifted with the CSS 3 Positioning Module - but that doesn’t necessary mean, IE has kept up.
If you nest an additional element into your table cells and apply position, z-index and background to that, you should be able to get this basically working, https://jsfiddle.net/pjz43a52/10
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53235563%2fie11-not-recognizing-z-index-1%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
<table>
is cancer...
Although I don't know WHY exactly such behaviors happen... But yeah - that's compatibility issues and we've to hack around it, so if we re-use the same code you wrote before, but instead of using a <table>
we will use only <div>
, the result will be the same, but it will work on IE11 - I tested it for you!
.container
background-color: #fafafa;
z-index: 0;
.table
position: relative;
width: 100px;
z-index: 1;
border-spacing: 0px;
border-bottom: 1px solid black;
.table .col
position:relative;
background-color: #EFEFEF;
z-index: -1;
border-top: 1px solid black;
border-right: 1px solid black;
border-left: 1px solid black;
.table .row:hover
position: relative;
box-shadow:
inset 5px 0 0 #dadce0,
inset -3px 0 0 #dadce0,
0 5px 2px 0 rgba(60,64,67,.3),
0 5px 3px 1px rgba(60,64,67,.15);
<div class="container">
<div class="table">
<div class="row">
<div class="col">Some Value</div>
</div>
<div class="row">
<div class="col">Some Value</div>
</div>
<div class="row">
<div class="col">Some Value</div>
</div>
</div>
</div>
add a comment |
<table>
is cancer...
Although I don't know WHY exactly such behaviors happen... But yeah - that's compatibility issues and we've to hack around it, so if we re-use the same code you wrote before, but instead of using a <table>
we will use only <div>
, the result will be the same, but it will work on IE11 - I tested it for you!
.container
background-color: #fafafa;
z-index: 0;
.table
position: relative;
width: 100px;
z-index: 1;
border-spacing: 0px;
border-bottom: 1px solid black;
.table .col
position:relative;
background-color: #EFEFEF;
z-index: -1;
border-top: 1px solid black;
border-right: 1px solid black;
border-left: 1px solid black;
.table .row:hover
position: relative;
box-shadow:
inset 5px 0 0 #dadce0,
inset -3px 0 0 #dadce0,
0 5px 2px 0 rgba(60,64,67,.3),
0 5px 3px 1px rgba(60,64,67,.15);
<div class="container">
<div class="table">
<div class="row">
<div class="col">Some Value</div>
</div>
<div class="row">
<div class="col">Some Value</div>
</div>
<div class="row">
<div class="col">Some Value</div>
</div>
</div>
</div>
add a comment |
<table>
is cancer...
Although I don't know WHY exactly such behaviors happen... But yeah - that's compatibility issues and we've to hack around it, so if we re-use the same code you wrote before, but instead of using a <table>
we will use only <div>
, the result will be the same, but it will work on IE11 - I tested it for you!
.container
background-color: #fafafa;
z-index: 0;
.table
position: relative;
width: 100px;
z-index: 1;
border-spacing: 0px;
border-bottom: 1px solid black;
.table .col
position:relative;
background-color: #EFEFEF;
z-index: -1;
border-top: 1px solid black;
border-right: 1px solid black;
border-left: 1px solid black;
.table .row:hover
position: relative;
box-shadow:
inset 5px 0 0 #dadce0,
inset -3px 0 0 #dadce0,
0 5px 2px 0 rgba(60,64,67,.3),
0 5px 3px 1px rgba(60,64,67,.15);
<div class="container">
<div class="table">
<div class="row">
<div class="col">Some Value</div>
</div>
<div class="row">
<div class="col">Some Value</div>
</div>
<div class="row">
<div class="col">Some Value</div>
</div>
</div>
</div>
<table>
is cancer...
Although I don't know WHY exactly such behaviors happen... But yeah - that's compatibility issues and we've to hack around it, so if we re-use the same code you wrote before, but instead of using a <table>
we will use only <div>
, the result will be the same, but it will work on IE11 - I tested it for you!
.container
background-color: #fafafa;
z-index: 0;
.table
position: relative;
width: 100px;
z-index: 1;
border-spacing: 0px;
border-bottom: 1px solid black;
.table .col
position:relative;
background-color: #EFEFEF;
z-index: -1;
border-top: 1px solid black;
border-right: 1px solid black;
border-left: 1px solid black;
.table .row:hover
position: relative;
box-shadow:
inset 5px 0 0 #dadce0,
inset -3px 0 0 #dadce0,
0 5px 2px 0 rgba(60,64,67,.3),
0 5px 3px 1px rgba(60,64,67,.15);
<div class="container">
<div class="table">
<div class="row">
<div class="col">Some Value</div>
</div>
<div class="row">
<div class="col">Some Value</div>
</div>
<div class="row">
<div class="col">Some Value</div>
</div>
</div>
</div>
.container
background-color: #fafafa;
z-index: 0;
.table
position: relative;
width: 100px;
z-index: 1;
border-spacing: 0px;
border-bottom: 1px solid black;
.table .col
position:relative;
background-color: #EFEFEF;
z-index: -1;
border-top: 1px solid black;
border-right: 1px solid black;
border-left: 1px solid black;
.table .row:hover
position: relative;
box-shadow:
inset 5px 0 0 #dadce0,
inset -3px 0 0 #dadce0,
0 5px 2px 0 rgba(60,64,67,.3),
0 5px 3px 1px rgba(60,64,67,.15);
<div class="container">
<div class="table">
<div class="row">
<div class="col">Some Value</div>
</div>
<div class="row">
<div class="col">Some Value</div>
</div>
<div class="row">
<div class="col">Some Value</div>
</div>
</div>
</div>
.container
background-color: #fafafa;
z-index: 0;
.table
position: relative;
width: 100px;
z-index: 1;
border-spacing: 0px;
border-bottom: 1px solid black;
.table .col
position:relative;
background-color: #EFEFEF;
z-index: -1;
border-top: 1px solid black;
border-right: 1px solid black;
border-left: 1px solid black;
.table .row:hover
position: relative;
box-shadow:
inset 5px 0 0 #dadce0,
inset -3px 0 0 #dadce0,
0 5px 2px 0 rgba(60,64,67,.3),
0 5px 3px 1px rgba(60,64,67,.15);
<div class="container">
<div class="table">
<div class="row">
<div class="col">Some Value</div>
</div>
<div class="row">
<div class="col">Some Value</div>
</div>
<div class="row">
<div class="col">Some Value</div>
</div>
</div>
</div>
answered Nov 10 at 3:20
Elharony
358113
358113
add a comment |
add a comment |
Since you are setting the Z-Index property, when you using F12 developer tools (using IE 11) to select the elements, you can only select the table elements, instead of the tr, so, it will not trigger the hover action. Screenshot as below:
To solve this issue, you could add the following CSS style:
table tr
display:block;
Then, when using F12 developer tools to select elements, we could select the table row. Thus, it will trigger the hover action.
The test sample as below:
<style type="text/css">
table
position: relative;
z-index: 1;
border-spacing: 0px;
border-bottom: 1px solid black;
table td
border-top: 1px solid black;
border-right: 1px solid black;
border-left: 1px solid black;
table tr
display:block;
.container
background-color: #fafafa;
z-index: 0;
table td
position: relative;
background-color: #EFEFEF;
z-index: -1;
table tr:hover
position: relative;
box-shadow: inset 5px 0 0 #dadce0, inset -3px 0 0 #dadce0, 0 5px 2px 0 rgba(60,64,67,.3), 0 5px 3px 1px rgba(60,64,67,.15);
</style>
<div class="container">
<table>
<tbody>
<tr>
<td>Some Value</td>
</tr>
<tr>
<td>Some Value</td>
</tr>
<tr>
<td>Some Value</td>
</tr>
</tbody>
</table>
</div>
The result:
add a comment |
Since you are setting the Z-Index property, when you using F12 developer tools (using IE 11) to select the elements, you can only select the table elements, instead of the tr, so, it will not trigger the hover action. Screenshot as below:
To solve this issue, you could add the following CSS style:
table tr
display:block;
Then, when using F12 developer tools to select elements, we could select the table row. Thus, it will trigger the hover action.
The test sample as below:
<style type="text/css">
table
position: relative;
z-index: 1;
border-spacing: 0px;
border-bottom: 1px solid black;
table td
border-top: 1px solid black;
border-right: 1px solid black;
border-left: 1px solid black;
table tr
display:block;
.container
background-color: #fafafa;
z-index: 0;
table td
position: relative;
background-color: #EFEFEF;
z-index: -1;
table tr:hover
position: relative;
box-shadow: inset 5px 0 0 #dadce0, inset -3px 0 0 #dadce0, 0 5px 2px 0 rgba(60,64,67,.3), 0 5px 3px 1px rgba(60,64,67,.15);
</style>
<div class="container">
<table>
<tbody>
<tr>
<td>Some Value</td>
</tr>
<tr>
<td>Some Value</td>
</tr>
<tr>
<td>Some Value</td>
</tr>
</tbody>
</table>
</div>
The result:
add a comment |
Since you are setting the Z-Index property, when you using F12 developer tools (using IE 11) to select the elements, you can only select the table elements, instead of the tr, so, it will not trigger the hover action. Screenshot as below:
To solve this issue, you could add the following CSS style:
table tr
display:block;
Then, when using F12 developer tools to select elements, we could select the table row. Thus, it will trigger the hover action.
The test sample as below:
<style type="text/css">
table
position: relative;
z-index: 1;
border-spacing: 0px;
border-bottom: 1px solid black;
table td
border-top: 1px solid black;
border-right: 1px solid black;
border-left: 1px solid black;
table tr
display:block;
.container
background-color: #fafafa;
z-index: 0;
table td
position: relative;
background-color: #EFEFEF;
z-index: -1;
table tr:hover
position: relative;
box-shadow: inset 5px 0 0 #dadce0, inset -3px 0 0 #dadce0, 0 5px 2px 0 rgba(60,64,67,.3), 0 5px 3px 1px rgba(60,64,67,.15);
</style>
<div class="container">
<table>
<tbody>
<tr>
<td>Some Value</td>
</tr>
<tr>
<td>Some Value</td>
</tr>
<tr>
<td>Some Value</td>
</tr>
</tbody>
</table>
</div>
The result:
Since you are setting the Z-Index property, when you using F12 developer tools (using IE 11) to select the elements, you can only select the table elements, instead of the tr, so, it will not trigger the hover action. Screenshot as below:
To solve this issue, you could add the following CSS style:
table tr
display:block;
Then, when using F12 developer tools to select elements, we could select the table row. Thus, it will trigger the hover action.
The test sample as below:
<style type="text/css">
table
position: relative;
z-index: 1;
border-spacing: 0px;
border-bottom: 1px solid black;
table td
border-top: 1px solid black;
border-right: 1px solid black;
border-left: 1px solid black;
table tr
display:block;
.container
background-color: #fafafa;
z-index: 0;
table td
position: relative;
background-color: #EFEFEF;
z-index: -1;
table tr:hover
position: relative;
box-shadow: inset 5px 0 0 #dadce0, inset -3px 0 0 #dadce0, 0 5px 2px 0 rgba(60,64,67,.3), 0 5px 3px 1px rgba(60,64,67,.15);
</style>
<div class="container">
<table>
<tbody>
<tr>
<td>Some Value</td>
</tr>
<tr>
<td>Some Value</td>
</tr>
<tr>
<td>Some Value</td>
</tr>
</tbody>
</table>
</div>
The result:
edited Nov 12 at 9:42
answered Nov 12 at 9:35
Zhi Lv - MSFT
36214
36214
add a comment |
add a comment |
Is there any known issue with IE11 and z-index: -1?
This is likely not related to z-index directly, but due to the fact that CSS 2.1 specified that,
The effect of
position:relative
on table-row-group, table-header-group, table-footer-group, table-row, table-column-group, table-column, table-cell, and table-caption elements is undefined. (https://www.w3.org/TR/CSS2/visuren.html#propdef-position)
This restriction has been lifted with the CSS 3 Positioning Module - but that doesn’t necessary mean, IE has kept up.
If you nest an additional element into your table cells and apply position, z-index and background to that, you should be able to get this basically working, https://jsfiddle.net/pjz43a52/10
add a comment |
Is there any known issue with IE11 and z-index: -1?
This is likely not related to z-index directly, but due to the fact that CSS 2.1 specified that,
The effect of
position:relative
on table-row-group, table-header-group, table-footer-group, table-row, table-column-group, table-column, table-cell, and table-caption elements is undefined. (https://www.w3.org/TR/CSS2/visuren.html#propdef-position)
This restriction has been lifted with the CSS 3 Positioning Module - but that doesn’t necessary mean, IE has kept up.
If you nest an additional element into your table cells and apply position, z-index and background to that, you should be able to get this basically working, https://jsfiddle.net/pjz43a52/10
add a comment |
Is there any known issue with IE11 and z-index: -1?
This is likely not related to z-index directly, but due to the fact that CSS 2.1 specified that,
The effect of
position:relative
on table-row-group, table-header-group, table-footer-group, table-row, table-column-group, table-column, table-cell, and table-caption elements is undefined. (https://www.w3.org/TR/CSS2/visuren.html#propdef-position)
This restriction has been lifted with the CSS 3 Positioning Module - but that doesn’t necessary mean, IE has kept up.
If you nest an additional element into your table cells and apply position, z-index and background to that, you should be able to get this basically working, https://jsfiddle.net/pjz43a52/10
Is there any known issue with IE11 and z-index: -1?
This is likely not related to z-index directly, but due to the fact that CSS 2.1 specified that,
The effect of
position:relative
on table-row-group, table-header-group, table-footer-group, table-row, table-column-group, table-column, table-cell, and table-caption elements is undefined. (https://www.w3.org/TR/CSS2/visuren.html#propdef-position)
This restriction has been lifted with the CSS 3 Positioning Module - but that doesn’t necessary mean, IE has kept up.
If you nest an additional element into your table cells and apply position, z-index and background to that, you should be able to get this basically working, https://jsfiddle.net/pjz43a52/10
answered Nov 12 at 9:53
misorude
1,3942312
1,3942312
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53235563%2fie11-not-recognizing-z-index-1%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown