last day (14 days later) » 

5:20 AM
<!--See this--> <!DOCTYPE html>
<html>
<style>
div#outer {
border: 2px dotted blue;
color: yellow;
background-color: yellow;
text-align: centre;
min-height: 5px;

}

div#inner {
border: 2px solid red;
color:green;
background-color: lightgrey;
padding: 10px;
margin: 10px;
position: absolute; z-index: -1;
}

div#inner:hover {
color: grey;
background-color: lightgreen;
border: 2px dotted red;

}
div#outer:hover {
color: grey;
background-color: black;
border: 2px solid red;

}
</style>
<body>

<div id="outer">
When we hover over the gray box the container div is automatically hovered. Now when we add some text in the yellow container then the yellow container extends horizontally to encapsulate the text. In doing so it obscures the gray box.
 
can't see gray box div.
 
5:35 AM
It's the inner div
<!--See this--> <!DOCTYPE html>
<html>
<style>
div#outer {
border: 2px dotted blue;
color: yellow;
background-color: yellow;
text-align: centre;
min-height: 5px;

}

div#inner {
border: 2px solid red;
color:green;
background-color: lightgrey;
padding: 10px;
margin: 10px;
position: absolute; z-index: 1;
}

div#inner:hover {
color: grey;
background-color: lightgreen;
border: 2px dotted red;

}
div#outer:hover {
color: grey;
background-color: black;
border: 2px solid red;

}
</style>
<body>

<div id="outer">
 
I am not getting you. Can you show me a fiddle.
 
I don't know what is a fiddle. Put the whole code here: w3schools.com/css/tryit.asp?filename=trycss_tooltip
 
Better to use fiddle: jsfiddle.net
anyway I am checking that now. Please tell me what you want to say.
 
There's a problem jsfiddle's editer is giving different results.
jsfiddle.net/Lz2xue0v allows Relatively positioned elements to be hovered.
 
5:55 AM
Your fiddle was incorrect. See this: jsfiddle.net/Lz2xue0v/1
You don't need to put body element inside html section and don't need to wrap with <style /> inside css section.
 
I am not familiar with that. You might now understand what I',m trying to say. The body covers the child element.
 
There's no any problem.
 
I've posted myself another answer there stackoverflow.com/a/35331849/3429430
 

last day (14 days later) »