ui-js-building-ui-layout-intro.md 1.5 KB
Newer Older
M
mamingshuai 已提交
1 2
# Layout Description<a name="EN-US_TOPIC_0000001063230905"></a>

Z
zengyawen 已提交
3
The baseline width for page design is 720 logical pixels. The display width of a page element depends on the ratio of the screen width to the baseline width.
Z
zengyawen 已提交
4

W
wusongqing 已提交
5
For example, when the width of a component is 100 px, its display width is converted as follows:
Z
zengyawen 已提交
6

Z
zengyawen 已提交
7
On a screen with the width of 720 physical pixels, the display width is 100 physical pixels. On a screen with the width of 1440 physical pixels, the display width is 200 physical pixels.
M
mamingshuai 已提交
8

Z
zengyawen 已提交
9
Basic page elements include title, text, and image areas. Each basic element may contain multiple sub-elements. You can add components, such as buttons, switches, and progress bars, to these elements and sub-elements as required. When setting the layout, you need to consider the following for each basic element:
M
mamingshuai 已提交
10 11

-   Size and arrangement
W
wusongqing 已提交
12
-   Overlapping with other elements
M
mamingshuai 已提交
13 14 15 16
-   Alignment, padding, and margin
-   Sub-elements and their positions
-   Container components and their types

W
wusongqing 已提交
17
You can disassemble elements on the page first and then implement them in sequence. This reduces visual confusion and logical conflicts caused by element nesting and improves code readability for easier modification. For example, as shown below, you disassemble the page elements and elements in the comment area.
M
mamingshuai 已提交
18 19 20 21 22 23 24

**Figure  1**  Page layout<a name="fig11335192315417"></a>  
![](figures/page-layout.png "page-layout")

**Figure  2**  Layout of the comment area<a name="fig186911810182717"></a>  


Z
zengyawen 已提交
25
![](figures/figures3.png)
M
mamingshuai 已提交
26