css flex gap between items
/* limited support (Q1/2021: Firefox, Chrome, Safari) */
.flex-container
{
display: flex;
gap: 5px;
}
/* broad support */
.flex-item
{
margin: 5px;
/* and/or */
padding: 5px;
}
css flex gap between items
/* limited support (Q1/2021: Firefox, Chrome, Safari) */
.flex-container
{
display: flex;
gap: 5px;
}
/* broad support */
.flex-item
{
margin: 5px;
/* and/or */
padding: 5px;
}
flex lines between items
######## HTML ########
<div class="Container">
<ul class="Flex">
<li class="Flex-item">Lorem</li>
<li class="Flex-item">consectetur</li>
<li class="Flex-item">vestibulum</li>
<li class="Flex-item">nec</li>
<li class="Flex-item">condimentum</li>
</ul>
</div>
########## CSS ###########
html {
box-sizing: border-box;
}
.Container {
max-width: 70%;
margin-right: auto;
margin-left: auto;
background: blue;
padding-top: 20px;
padding-bottom: 20px;
}
.Flex {
display: flex;
flex-flow: row wrap;
justify-content: space-between;
list-style: none;
margin: 0;
padding: 0;
}
.Flex-item {
flex: 1 1 auto;
background: red;
position: relative;
text-align: center;
line-height: 40px;
}
.Flex-item + .Flex-item {
border-left: solid 1px white;
}
/** Optional for OPs exact layout */
.Flex-item:first-child {
text-align: left;
}
.Flex-item:last-child {
text-align: right;
}
reference:
https://stackoverflow.com/questions/41631136/add-dividing-line-between-flex-items-with-equal-space-distribution/42160101
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us