search

Home  >  Q&A  >  body text

css3 - css 3问题, transition:0.5s all;是指所有属性?

w3cSchool这样说的:

天蓬老师天蓬老师2778 days ago1123

reply all(3)I'll reply

  • ringa_lee

    ringa_lee2017-04-17 11:47:58

    That’s pretty much what the questioner said, but let’s be clear, all refers to everything,

    p{
        width: 200px;
        height: 200px;
        margin: 300px auto;
        background-color: #336699;
        
        transition: all 1s;
        /*transition: height 1s;*/
    }
    p:hover{
        width: 300px;
        height: 400px;
    }

    I think all here refers to the style after the transition. The above code runs and the width and height of p change smoothly. When we change all to height, only the height transformation process has animation effects. width is an instant change.

    reply
    0
  • 黄舟

    黄舟2017-04-17 11:47:58

    Yes, all can also be omitted without writing

    reply
    0
  • 黄舟

    黄舟2017-04-17 11:47:58

    Yes, it is recommended to specify a certain attribute when using it

    reply
    0
  • Cancelreply