BAT及各大互联网公司2014前端笔试面试题(Html,Css篇)

2020-05-16 06:59:26易采站长站整理

        background-color:yellow;    /*ie8*/  
        +background-color:pink;        /*ie7*/  
        _background-color:orange;       /*ie6*/    }     
        :root #test { background-color:purple9; }  /*ie9*/  
    @media all and (min-width:0px){ #test {background-color:black;} }  /*opera*/  
    @media screen and (-webkit-min-device-pixel-ratio:0){ #test {background-color:gray;} }       /*chrome and safari*/  

6.请用Css写一个简单的幻灯片效果页面

  答案:知道是要用css3。使用animation动画实现一个简单的幻灯片效果。

CSS Code复制内容到剪贴板

/**HTML**/  
        div.ani   
  
        /**css**/  
        .ani{   
          width:480px;   
          height:320px;   
          margin:50px auto;   
          overflow: hidden;   
          box-shadow:0 0 5px rgba(0,0,0,1);   
          background-size: cover;   
          background-position: center;   
          -webkit-animation-name: "loops";   
          -webkit-animation-duration: 20s;   
          -webkit-animation-iteration-count: infinite;   
        }   
        @-webkit-keyframes "loops" {   
            0% {   
                background:url(http://d.hiphotos.baidu.com/image/w%3D400/sign=c01e6adca964034f0fcdc3069fc27980/e824b899a9014c08e5e38ca4087b02087af4f4d3.jpg) no-repeat;