I am using flexbox to align divs, and I want to make both postavatar
and userinfo
in left side and posttime
to be in the right.
.postheader {
display: flex;
justify-content: space-between;
}
.postheader .postavatar img {
width: 90px;
}
.postheader .userinfo {
margin-top: 10px;
margin-left: 20px;
}
.postheader .userinfo .postusername {
color: #b3b3b3;
}
.postheader .posttime {
color: #b3b3b3;
}
Fahad Aldaferi
@Q8Xbox
24 m
Answer
You can simply remove justify-content: space-between;
from the flex container, and add margin-left: auto;
on last flex item.
.postheader {
display: flex;
/*justify-content: space-between;*/
}
.postheader .postavatar img {
width: 90px;
}
.postheader .userinfo {
margin-top: 10px;
margin-left: 20px;
}
.postheader .userinfo .postusername {
color: #b3b3b3;
}
.postheader .posttime {
color: #b3b3b3;
margin-left: auto; /*new*/
}
Fahad Aldaferi
@Q8Xbox
24 m
No comments:
Post a Comment