Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>Titre du document</title> <style> .purple-box { display: flex; align-items: center; justify-content: center; } .purple-square { background-color: #b10dc9; width: 300px; height: 300px; } h2, h3 { text-align: center; color: #4287f5; } </style> </head> <body> <h2>W3docs</h2> <h3>Div centré horizontalement</h3> <div class="purple-box"> <div class="purple-square"></div> </div> </body> </html>