Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
81
rated 0 times [  84] [ 3]  / answers: 1 / hits: 134602  / 15 Years ago, wed, march 17, 2010, 12:00:00

Is it possible to set the height/width of an element in percent using JavaScript or jQuery?


More From » jquery

 Answers
25
document.getElementById('header').style.width = '50%';


If you are using Firebug or the Chrome/Safari Developer tools, execute the above in the console, and you'll see the Stack Overflow header shrink by 50%.


[#97314] Sunday, March 14, 2010, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
brennonr

Total Points: 124
Total Questions: 101
Total Answers: 101

Location: Estonia
Member since Wed, Jun 8, 2022
2 Years ago
;