Created
June 1, 2022 19:44
-
-
Save gsrai/cf5c97cac67105a5e81e5fdfad76928f to your computer and use it in GitHub Desktop.
Revisions
-
gsrai created this gist
Jun 1, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ <!DOCTYPE html> <html> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>center a div</title> <style> .container { height: 100vh; display: flex; align-items: center; justify-content: center; } .content { max-width: 200px; max-height: 200px; } </style> </head> <body> <div class="container"> <!-- just imagine this is a div --> <img class="content" src="https://picsum.photos/200" /> </div> </body> </html>