为什么CSS3动画在我的ASP.net网站上不起作用

时间:2015-05-27 15:08:19

标签: html asp.net css3

我有一个ASP.net网站,我有以下内容......

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/

它在常规网页中运行良好,但当我将其添加到我的.net网站时,功能区显示时没有动画。

如何解决问题。

调试模式:

enter image description here

3 个答案:

答案 0 :(得分:2)

你使用的是sitemaster.if你使用它在网站管理员上放置css

答案 1 :(得分:1)

查看ClientIDMode指令的@Page属性。 ASP.NET倾向于自动调整客户端生成的ID,这会导致CSS无法处理#sample3选择器,因为除非该属性设置为Static,否则HTML中不存在此ID。详细了解ClientIDMode on MSDN

答案 2 :(得分:0)

所有代码(HTML / CSS)都正确放置在我的网站中。 IE只花了一整天刷新页面。我不得不重置强制刷新的IIS站点,然后它才能运行。