html - CSS3 Target Div Overlay Webkit Transition -


is possible add opacity transition css3 div overlay target?

jsfiddle: http://jsfiddle.net/pb7st/

#content {     background-color: #ccc;     height: 300px;     width: 300px;     z-index:1; } .overlaystyle {     height: 100px;     width: 100px;     background-color: #000;     left: 20px;     top: 20px;     position: absolute;     z-index:2;     opacity: 0;     -webkit-transition: opacity 1s ease; } #overlay {     display:none; } #overlay:target {     display:block;     opacity: 1; } 

is there other (better) way close / hide div? i'm using:

href="#_" 

yes, there is:

jsfiddle demo

css

.overlaystyle {     height: 100px;     width: 100px;     background-color: #000;     left: 20px;     top: 20px;     position: absolute;     z-index:2;     opacity: 0;     -webkit-transition: opacity 1s ease, visibility 1s 0s; /* added visibility transition */ } #overlay {     //display:none;     visibility:hidden } #overlay:target {     //display:block;     visibility:visible;     opacity: 1; } 

edited add transition visibility delay fade-out effect. personally, i'd go jquery. :)


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

android - Keyboard hides my half of edit-text and button below it even in scroll view -

css - Make div keyboard-scrollable in jQuery Mobile? -