Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
21
rated 0 times [  25] [ 4]  / answers: 1 / hits: 59861  / 8 Years ago, sun, april 10, 2016, 12:00:00

I use this code in JS:



bigPhoto.setAttribute(width, 200rem);



The result is in pixel in html source,



enter



But:



enter



When I change it to 20rem the photo become really small.



I couldn't solve the problem which is mentioned in the photos.


More From » html

 Answers
1

The HTML width attribute only takes an integer number of pixels or a percentage (followed by a % sign).



If you wish to use CSS length units you have to use CSS (and set bigPhoto.style.width = 200rem.


[#62628] Thursday, April 7, 2016, 8 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
finn

Total Points: 154
Total Questions: 88
Total Answers: 82

Location: Lithuania
Member since Mon, Nov 16, 2020
4 Years ago
;