html - What is the best way to set width and height of elements? -


Every website has elements and their width and height should be set. This is my question, how can we determine the width and height that the website works correctly on different monitors with different width / height? px is preferred to % ? When we need px and when should we use% What are the advantages and disadvantages of each?

When you want to specify a fixed / constant height in pixels, use PX% element mother Refers to the total percentage of the father. Percentage means that the web site will be optimized when the size of the browser will be resized using the size of the pixel.

Whatever you choose depends on actually looking and feeling that you are trying to achieve.


Comments