📜  jquery css 多行 - CSS 代码示例

📅  最后修改于: 2022-03-11 14:47:52.853000             🧑  作者: Mango

代码示例1
/* To avoid writing the same line several times 
   You can use multiple lines in the css function*/

    $('.selector').css({
     'font-size' : '10px',
     'width' : '30px',
     'height' : '10px'
    });

/* Obviously you can store these value in a variable too */

    var style = {
     'font-size' : '10px',
     'width' : '30px',
     'height' : '10px'
    }

    $('.selector').css(style);