css3 - CSS transition is under an element with position realative or absolute -


Why when you set an element in a relative or complete position, the elements of the transition are under this element, but When the position of the situation is removed?

HTML:

  & lt; Div class = 'square' & gt; & Lt; / Div & gt; & Lt; Div class = 'text' & gt; Text here & lt; / Div & gt;  

CSS:

  .square {width: 100px; Height: 100 pixels; Background color: red; Infection: all 0.5 S. 0.1 linear; Status: Completed; Margin-top: 20px; } .square: hover {margin-top: -50px; } .text {status: relative; } Do not forget to set    

z-index Property to your style when you decide to declare the status .

For example z-index: 10 try your .square box here demo is working -

this There is a good tutorial to know how it works -


Comments

Popular posts from this blog

c# - SignalR: "Protocol error: Unknown transport." when navigating to hub -

class - Kivy: how to instantiate a dynamic classes in python -

python - mayavi mapping a discrete colorbar on a surface -