Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>Titre du document</title> <meta name="viewport" content="width=device-width, initial-scale=1" /> <style> .container { background-color: green; position: relative; width: 100%; padding-top: 62.5%; /* 8:5 Aspect Ratio */ } .text { position: absolute; top: 0; left: 0; bottom: 0; right: 0; text-align: center; font-size: 25px; color: black; } </style> </head> <body> <h2>Aspect Ratio 8:5</h2> <p>Redimensionnez la fenĂȘtre pour voir l'effet.</p> <div class="container"> <div class="text">8:5 Aspect ratio</div> </div> </body> </html>