Web Layouts: Pixels vs. Percent

What are the use cases for determining distances in a web layout for pixels and percent?

Is there a drawback to using pixels with respect to multiple resolutions? Will they scale correctly?

+3
source share
5 answers

Percentage Layout

This is commonly called a liquid layout. Your items will occupy a certain percentage of the total area available to them. This available space is determined by the parent of the element.

When using percentage layouts, it is recommended that you specify min-width and max-width so that it remains usable at very low and high resolutions.

Pros

  • , , .

  • - . .
  • , ( ) , .

. .

Pros

  • .
  • .

  • . , , .
+6

, .

, , div.

, .

.

- , div / ( ) , .

NB: , ...

: , , .

+2

, - , CSS, DIV, , , , , , , , , javascript, , ( ).

+1

.

. ( ) ( ). Em pt .

, , . , , ems. , , .

IE6; "" CSS , , , CSS.

+1

Be careful using percentages, web browsers do not calculate percentages correctly. This is all because webkit is not calculating subpixels correctly.

You can read more about this problem here: Percentage errors in webkit

I would recommend that you always use pixels so that there are no differences in layout sizes between browsers.

+1
source

Source: https://habr.com/ru/post/1762938/


All Articles