Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript convert px to vw

//1px = 100vw / viewport's width (in px)

function convertPXToVW(px) {
	return px * (100 / document.documentElement.clientWidth);
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #convert #px #vw
ADD COMMENT
Topic
Name
4+3 =