Reputation:
I want to show a container with overlay (mean black theme display on background) which displays slowly and displays in full after few seconds. So I used opacity property in that but it is not working for me.
I want to show the container slowly with black overlay using css.
here is jsfiddle:
http://jsfiddle.net/g7Jj2/
#container{
width:100%;
opacity: 0;
-webkit-transition: opacity 2s;
}
.cc{
opacity: 1;
}
Thanks
Upvotes: 0
Views: 57
Reputation: 1605
hope it will help you
#container{
width:100%;
background:red;
height:100px;
opacity: 0;
transition: opacity 2s ease;
-webkit-transition: opacity 2s ease;
}
#container.cc{
opacity: 1;
}
Upvotes: 0
Reputation: 16961
Demo: http://jsfiddle.net/g7Jj2/1/
Your CSS is being overridden due to specificity.
Use this instead:
#container.cc{
opacity: 1;
}
Upvotes: 1