Sunday, June 2, 2024
 Popular · Latest · Hot · Upcoming
160
rated 0 times [  166] [ 6]  / answers: 1 / hits: 32522  / 13 Years ago, wed, march 14, 2012, 12:00:00

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?


More From » javascript

 Answers
26
document.body.style.paddingTop = '10px'

[#86860] Tuesday, March 13, 2012, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
bradley

Total Points: 555
Total Questions: 102
Total Answers: 99

Location: Tajikistan
Member since Fri, Nov 27, 2020
4 Years ago
;