Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does CSS3 animation not work in my ASP.net website

Tags:

html

css

asp.net

I have an ASP.net website where I have the following...

HTML:

<div style="width: 99%; margin: 0; padding: 0; text-align: left; overflow: hidden;">
            <div id="sample3" lang="is" class="sample3">

    <figure>
        <img src="../theImages/imgPra.png" width="160" height="160" alt="Specialty Profile" />
        <figcaption>Specialty Profile</figcaption>
    </figure>

<!--end sample3--></div>
        </div>

CSS:

.sample3 figure {
    width: 200px;
    height: 200px;
    overflow: hidden;
    position: relative;
    background: url('../theImages/preview4.jpg') fixed no-repeat;
}

.sample3 figcaption {
        position: absolute;
    display: block;
    width: 350px;
    height: 50px;
    left: 110px;
    bottom: -110px;
    text-align: center;
    color: #fff;
    background-color: rgba(26,54,59,0.8);
    border: 3px solid rgba(62,116,126,0.6);
    line-height: 50px;
    -moz-box-shadow: rgba(0,0,0,.5) 0 2px 8px;
    -webkit-box-shadow: rgba(0,0,0,.5) 0 2px 8px;
    box-shadow: rgba(0,0,0,.5) 0 2px 8px;
    -moz-transform:rotate(-45deg);
    -webkit-transform:rotate(-45deg);
    -o-transform:rotate(-45deg);
    transform:rotate(-45deg);
    -moz-transition: bottom .5s ease-out, left .5s ease-out;
    -webkit-transition: bottom .5s ease-out, left .5s ease-out;
    -o-transition: bottom .5s ease-out, left .5s ease-out;
    transition: bottom .5s ease-out, left .5s ease-out;
}

.sample3 figure:hover figcaption {
    left: -20px;
    bottom: 20px;
}

JSFiddle: http://jsfiddle.net/vas1watw/

It works fine in a regular webpage, but when I add it to my .net website, the ribbon is displayed without the animation.

How can I resolve the issue.

debug mode:

enter image description here

like image 369
SearchForKnowledge Avatar asked Sep 08 '25 07:09

SearchForKnowledge


2 Answers

are you using sitemaster.if you using it place css on sitemaster

like image 196
Srinivasa Avatar answered Sep 09 '25 19:09

Srinivasa


Take a look at the ClientIDMode property of the @Page directive. ASP.NET tends to auto adjust the client generated ids, which causes your CSS to nome handle #sample3 selector since this Id will not exists in the HTML, unless that property is set to Static. Read more about ClientIDMode on MSDN.

like image 37
Erick Petrucelli Avatar answered Sep 09 '25 21:09

Erick Petrucelli