S
S
SLaMeeR2016-04-01 18:45:25
css
SLaMeeR, 2016-04-01 18:45:25

How to make animation display none/block?

There is a short snippet of css code

#header_profile_flat_new_settings_wrap_pad_right {
 float: left;
 width: 35px;
 text-align: center;
 cursor: pointer;
 margin-top: 11px;
}

#header_profile_flat_new_settings_icon {
 display: inline-block;
 background: url('../images/header_profile_flat_new_settings_icon.png') no-repeat;
 width: 18px;
 height: 18px;
 opacity: 0.8;
 -webkit-transition: all 0.2s ease-in-out;  
 -moz-transition: all 0.2s ease-in-out;  
 -o-transition: all 0.2s ease-in-out;  
 -ms-transition: all 0.2s ease-in-out;  
 transition: all 0.2s ease-in-out;
}

#header_profile_flat_new_settings_icon:hover {
 opacity: 1;
}

#header_profile_flat_new_settings_list_wrap {
 display: none;
 position: absolute;
 background: #537296;
 border-top: 1px solid #5b7ba1;
 -webkit-border-bottom-right-radius: 3px; 
 -webkit-border-bottom-left-radius: 3px; 
 -moz-border-radius-bottomright: 3px; 
 -moz-border-radius-bottomleft: 3px; 
 border-bottom-right-radius: 3px; 
 border-bottom-left-radius: 3px;
 margin-top: -2px;
 width: 174px;
 z-index: 999;
}

#header_profile_flat_new_settings_list_wrap a {
 display: block;
 padding: 10px;
 color: #c8d8ea;
 text-decoration: none;
 -webkit-transition: all 0.2s ease-in-out;  
 -moz-transition: all 0.2s ease-in-out;  
 -o-transition: all 0.2s ease-in-out;  
 -ms-transition: all 0.2s ease-in-out;  
 transition: all 0.2s ease-in-out;
}

#header_profile_flat_new_settings_list_wrap a:last-child {
 -webkit-border-bottom-right-radius: 3px;
 -webkit-border-bottom-left-radius: 3px;
 -moz-border-radius-bottomright: 3px;
 -moz-border-radius-bottomleft: 3px;
 border-bottom-right-radius: 3px;
 border-bottom-left-radius: 3px;
}

#header_profile_flat_new_settings_list_wrap a:hover {
 background: #5b7ba1;
 z-index: 1000;
 color: #ffffff;
}

#header {
 background: url('../images/nhead.png') #5e7b9c;
 border-bottom: 1px solid #4d6b92;
 width: 100%;
 height: 43px;
 line-height: 1;
 color: #ffffff;
 overflow: hidden;
 position: fixed;
 z-index: 1000;
 -webkit-transition: opacity 0.5s;
-moz-transition: opacity 0.5s;
-o-transition: opacity 0.5s;
transition: opacity 0.5s;
}

#header.noactive {
 opacity: 0.8;
}

#header:hover {
 opacity: 1;
}

#header_bottom {
 border-top: 1px solid #405f85;
}

How to make a simple Display none / block animation in html from it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim, 2016-04-01
@AlBandito

Specifically, with the help Display none/blockyou can make animation only through JS.
If you need animation in pure css, then opacity и transitionhelp.

C
Chekistchek, 2017-08-16
@Chekistchek

If position: fixed or absolute, then you can try this:

#start_display {
    width: 100px;
    height: 100px;
    position: fixed;
    z-index: -999;
    animation-duration: 1s;
    animation-name: disappear; 
}
@keyframes disappear {
    0% {background-color: white;z-index: 999;}
    80% {background-color: white;}
    99.9% {z-index: 999}
    100% {background-color: none;z-index: -999;}
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question