% Or px is better in positioning elements in HTML? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

% Or px is better in positioning elements in HTML?

We can use both % as well as px for properties like top and left. But what is the best method to set position of elements.

8th Nov 2019, 7:43 AM
Manpreet Kaur
Manpreet Kaur - avatar
4 Answers
+ 5
vh for top and height vw for left and width Run the tutorial, rotate your phone by 90 deg too see why.
8th Nov 2019, 9:33 AM
Gordon
Gordon - avatar
+ 3
I think % is better for a responsive feature
8th Nov 2019, 8:48 AM
Dace [Super Inactive| Challenge=Maybe]
Dace [Super Inactive| Challenge=Maybe] - avatar
0
Gordon I specifically asked for "top" And "width" I didn't get these on this link
8th Nov 2019, 9:29 AM
Manpreet Kaur
Manpreet Kaur - avatar