about size/resize, and measurements: when assigning width or height, px is often! how many px's are there per inch or per cm? for width, it is convenient, with some other measurements applicable, but for height? px's is rather imperceptible! I tried to attribute a certain height in my code, what is best: px, rows, number of lines or what? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

about size/resize, and measurements: when assigning width or height, px is often! how many px's are there per inch or per cm? for width, it is convenient, with some other measurements applicable, but for height? px's is rather imperceptible! I tried to attribute a certain height in my code, what is best: px, rows, number of lines or what?

getting on frames , tables, forms, image resize, height attribute is embarrassing?

13th Jun 2016, 8:45 AM
Alexis Cheuk Yan Lee
Alexis Cheuk Yan Lee - avatar
3 Answers
+ 1
In web design, people used to talk about two main layout types: fluid using percentages and fixed layout using pixels. Now they add to them responsive layout which includes design for mobiles and tablets. Pixel size is unscalable, fixed. No matter the screen size, the pixel sized element will look the same. Elements with % size will scale according to screen size or parent container size. Use px for elements that you want to have a fixed size. Use it also for borders, shadows, border-radius and similar. Use % for fluid elements when you want them to scale up and down. There are other measurement units like em and pt. You also need to read a thorough tutorial for better and deeper understanding of this important subject.
13th Jun 2016, 1:57 PM
ZinC
ZinC - avatar
0
As someone just starting coding myself, the reality I've noticed, even amongst expert coders, is that when it comes to measurements, it's really based on individual preference and understanding. If you perceive the concept of px better, go with that. Bogging yourself down with correlations in the beginning only makes the work twice as difficult. When you correctly input and assign px measurements, you'll eventually get the dimensions you're looking for. So much of coding is trial and error, so if things aren't immediately falling into place for you, don't be discouraged! Keep hammering away at the measurements, check your math, and you'll get the desired outcome.
13th Jun 2016, 9:03 AM
George Hooper
George Hooper - avatar
0
i am new to coding and i learned all using px. to be fair, using a software that gives you thr screen in px is most helpful. i tried using dreamweaver cs 5 and 6 and both found very easy to use and gives you the page in px.+ plus you can resize it to match any particular screen if you need. cs6 also is fast to use. also my last point goes the same as previous answer. twick with the size until you get what you want.. good luck
13th Jun 2016, 11:39 AM
Levi
Levi - avatar