标签:splay initial rgb ati pre class sla style bsp
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> </head> <style> .father { width: 300px; height: 300px; display: flex; } .child { margin: auto; } .father1 { width: 300px; height: 300px; position: relative; } .child1 { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); } .father2 { width: 300px; height: 300px; display: flex; justify-content: center; align-items: center; } .child2 {} </style> <body> <!-- flexbox布局 --> <div class="father"> <div class="child"> qweeeeeeeeeee </div> </div> <!-- 子绝父相 --> <div class="father1"> <div class="child1"> qweeeeeeeeeee </div> </div> <!-- flex布局 --> <div class="father2"> <div class="child2"> qweeeeeeeeeee </div> </div> </body> </html>
标签:splay initial rgb ati pre class sla style bsp
原文地址:https://www.cnblogs.com/lzhflzjx/p/14009635.html