Skip to content

Instantly share code, notes, and snippets.

@fureweb-com
Last active January 11, 2023 08:23
Show Gist options
  • Save fureweb-com/a710fb66ad48b867e384270c557ba126 to your computer and use it in GitHub Desktop.
Save fureweb-com/a710fb66ad48b867e384270c557ba126 to your computer and use it in GitHub Desktop.
flex display example
<!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