align-items center
بازگشت به صفحه اصلی
بازگشت به صفحه مقاله
دو ستونی
دو سطری
اجرای کد RUN »
<!DOCTYPE html> <html> <head> <style> .flex-container { display: flex; justify-content: center; align-items: center; height: 300px; background-color: DodgerBlue; } .flex-container>div { background-color: #f1f1f1; color: white; width: 100px; height: 100px; } </style> </head> <body> <h1>Perfect Centering</h1> <p>A container with both the justify-content and the align-items properties set to <em>center</em> will align the item(s) in the center (in both axis).</p> <div class="flex-container"> <div></div> </div> </body> </html>