Created
October 28, 2016 10:16
-
-
Save andrey-shikhov/f003d6c82ed307f6a1e24786207fcbeb to your computer and use it in GitHub Desktop.
css flexbox center with margin right
This file contains 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> | |
<head> | |
<style> | |
.flex-container { | |
display: -webkit-flex; | |
-webkit-justify-content: center; | |
display: flex; | |
width: 100px; | |
height: 20px; | |
background-color: lightgrey; | |
} | |
.flex-item { | |
background-color: cornflowerblue; | |
width: 20px; | |
height: 20px; | |
margin-right: 20px; | |
} | |
.item-10 { | |
background-color: white; | |
width: 10px; | |
height: 20px; | |
} | |
.item-10b { | |
background-color: black; | |
width: 10px; | |
height: 20px; | |
} | |
</style> | |
</head> | |
<body> | |
<div class="flex-container"> | |
<div class="item-10"></div> | |
<div class="item-10b"></div> | |
<div class="item-10"></div> | |
<div class="item-10b"></div> | |
<div class="item-10"></div> | |
<div class="item-10b"></div> | |
<div class="item-10"></div> | |
<div class="item-10b"></div> | |
<div class="item-10"></div> | |
<div class="item-10b"></div> | |
</div> | |
<div class="flex-container"> | |
<div class="flex-item"></div> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment