ui-js-building-ui-layout-intro.md 1.4 KB
Newer Older
G
ge-yafang 已提交
1 2
# Layout Description

M
mamingshuai 已提交
3

Z
zengyawen 已提交
4
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 已提交
5

G
ge-yafang 已提交
6

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

G
ge-yafang 已提交
9

Z
zengyawen 已提交
10
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 已提交
11

Z
zengyawen 已提交
12
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 已提交
13 14


G
ge-yafang 已提交
15 16 17 18 19 20 21
- Size and arrangement

- Overlapping with other elements

- Alignment, padding, and margin

- Sub-elements and their positions
M
mamingshuai 已提交
22

G
ge-yafang 已提交
23
- Container components and their types
M
mamingshuai 已提交
24

G
ge-yafang 已提交
25 26
  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.
  figure1 Page layout
M
mamingshuai 已提交
27

G
ge-yafang 已提交
28
  ![en-us_image_0000001222967792](figures/en-us_image_0000001222967792.png)
M
mamingshuai 已提交
29

G
ge-yafang 已提交
30
  figure2 Layout of the comment area
M
mamingshuai 已提交
31

G
ge-yafang 已提交
32
![en-us_image_0000001267767889](figures/en-us_image_0000001267767889.png)