Good day! There is the following css code

.wrapper, .wrapper ul { width: 100%; display: inline-block; margin: 0; padding: 0; vertical-align: bottom; } 

And html code:

 <div class="wrapper"> <ul> <li> <div><img src="/img/inf/1.png" width="120px" height="120px" /></div> <p>Lorem ipsum</p> </li> <li> <div><img src="/img/info/2.png" width="120px" height="120px" /></div> <p>Lorem ipsum</p> </li> <li> <div><img src="/img/info/3.png" width="120px" height="120px" /></div> <p>Lorem ipsum</p> </li> </ul> </div> <p>Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum</p> 

How to access the css class and change the value of the margin property using js?

    2 answers 2

    Through querySelector you address, through style you set.

     document.querySelector('.class').style.margin = 'value' + 'px'; 

      JS and Jquery work independently of the CMS, the main thing is to load the script (embed in the template, for example).

       $(".wrapper").css("margin", "5px");