“040abee1dc28eeefb2aa080fdc9abc50e8028009”上不存在“casts/free-podcasts-screencasts-en.md”
js-components-container-stack.md 1.6 KB
Newer Older
Z
zengyawen 已提交
1 2 3 4
# stack<a name="EN-US_TOPIC_0000001127125064"></a>

The  **<stack\>**  component provides a stack container where child components are successively stacked and the latter one overwrites the previous one.

Z
zengyawen 已提交
5
## Required Permissions<a name="section11257113618419"></a>
Z
zengyawen 已提交
6 7 8

None

Z
zengyawen 已提交
9
## Child Components<a name="s2936fc34a22b44aa8389d1ec3de8fa61"></a>
Z
zengyawen 已提交
10 11 12

Supported

Z
zengyawen 已提交
13
## Attributes<a name="s7207d4d586504fa3be62558273017fbe"></a>
Z
zengyawen 已提交
14 15 16

Attributes in  [Universal Attributes](js-components-common-attributes.md)  are supported.

Z
zengyawen 已提交
17
## Styles<a name="section1774719169253"></a>
Z
zengyawen 已提交
18 19 20

Styles in  [Universal Styles](js-components-common-styles.md)  are supported.

Z
zengyawen 已提交
21
## Events<a name="section1948143416285"></a>
Z
zengyawen 已提交
22 23 24

Events in  [Universal Events](js-components-common-events.md)  are supported.

Z
zengyawen 已提交
25
## Methods<a name="section2279124532420"></a>
Z
zengyawen 已提交
26 27 28

Methods in  [Universal Methods](js-components-common-methods.md)  are supported.

Z
zengyawen 已提交
29
## Example<a name="section18137649112711"></a>
Z
zengyawen 已提交
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72

```
<!-- xxx.hml -->
<stack class="stack-parent">
  <div class="back-child bd-radius"></div>
  <div class="positioned-child bd-radius"></div>
  <div class="front-child bd-radius"></div>
</stack>
```

```
/* xxx.css */
.stack-parent {
  width: 400px;
  height: 400px;
  background-color: #ffffff;
  border-width: 1px;
  border-style: solid;
}
.back-child {
  width: 300px;
  height: 300px;
  background-color: #3f56ea;
}
.front-child {
  width: 100px;
  height: 100px;
  background-color: #00bfc9;
}
.positioned-child {
  width: 100px;
  height: 100px;
  left: 50px;
  top: 50px;
  background-color: #47cc47;
}
.bd-radius {
  border-radius: 16px;
}
```

![](figures/en-us_image_0000001127284958.png)