Last active
January 11, 2023 08:23
-
-
Save fureweb-com/a710fb66ad48b867e384270c557ba126 to your computer and use it in GitHub Desktop.
flex display example
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 characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Flex box example</title> | |
<style> | |
.parents { | |
display: flex; | |
width: 100%; | |
height: 100%; | |
/* 자식들의 세로 정렬 */ | |
align-items: center; | |
/* 자식들의 가로 정렬 */ | |
justify-content: center; | |
} | |
</style> | |
</head> | |
<body> | |
<div class="parents"> | |
<div class="item"> | |
<img src="https://via.placeholder.com/350x150" alt=""> | |
</div> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment