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?
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
. .
, .
, , div.
.
- , div / ( ) , .
NB: , ...
: , , .
, - , CSS, DIV, , , , , , , , , javascript, , ( ).
. ( ) ( ). Em pt .
, , . , , ems. , , .
IE6; "" CSS , , , CSS.
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.
Source: https://habr.com/ru/post/1762938/More articles:Configuring the anonymous function scope 'this' in jQuery / ajax utility - javascriptJavaScript is a line item - javascriptUsing my weka classifier in MOA - new-operatorHow to complete a program in C ++ - c ++Is it possible to write to the event log contained in a folder using log4net? - log4netHow to convert json object to HTML format in java? - javaWSGI event scheduling - pythonJustify the text in the report - c #What was the name of the access set that allows you to set the value in the constructor? - c #Pyqt tabs, as in Google Chrome - pythonAll Articles