JavaScript CSS how to add and remove multiple CSS classes to an element

前端 未结 14 1959
迷失自我
迷失自我 2020-12-07 21:46

How can assign multiple css classes to an html element through javascript without using any libraries?

14条回答
  •  执念已碎
    2020-12-07 22:18

    Maybe this will help you learn:

    //
    /* external.css */
    html,body{
      padding:0; margin:0;
    }
    .main{
      width:980px; margin:0 auto;
    }
    
    
      
        
        
        
      
    
      

提交回复
热议问题