Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

changing top padding in javascript

Tags:

javascript

Here's how I set my top padding in my css:

body {
    font-size: {{ font_size }}px;
    margin: 0;
    padding: 100px 0 20px 0;
    width:100% !important;
}

How do I change the top padding, which is 100px on the example above using the simplest javascript function without using jQuery?

like image 658
xonegirlz Avatar asked Mar 14 '12 03:03

xonegirlz


1 Answers

document.body.style.paddingTop = '10px'
like image 129
Kristian Avatar answered Oct 19 '22 21:10

Kristian