File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1254,6 +1254,32 @@ Pick ONE OR MORE options
125412544. .parent { position : relative ; } .child { position : absolute ; top : 50% ; left : 50% ; transform : translate (-50% , -50% ); }
12551255```
12561256
1257+ <details > <summary > <b > Answer</b > </summary >
1258+
1259+ ```css
1260+ .parent {
1261+ display : flex ;
1262+ justify-content : center ;
1263+ align-items : center ;
1264+ }
1265+ ```
1266+
1267+ ```css
1268+ .parent {
1269+ position : relative ;
1270+ }
1271+ .child {
1272+ position : absolute ;
1273+ top : 50% ;
1274+ left : 50% ;
1275+ transform : translate (-50% , -50% );
1276+ }
1277+ ```
1278+
1279+ ** ⚝ ; [Try this example on CodeSandbox ](https://codesandbox.io/s/css-centering-xdj4lg ?file=/src/styles.css )**
1280+
1281+ </details >
1282+
12571283<div align="right">
12581284 <b > <a href="#" > ↥ back to top</a > </b >
12591285</div >
You can’t perform that action at this time.
0 commit comments