Back to Examples
Social Feed Layout
A social media feed layout using flexbox. Features a main content area with posts, user interactions, and a sidebar with profile and trending topics. Shows how to create complex nested flex layouts for modern social platforms.
PREVIEW
User Name
2 hours ago
This is a sample post content showing how flexbox can be used in social media layouts...
User Name
2 hours ago
This is a sample post content showing how flexbox can be used in social media layouts...
User Name
2 hours ago
This is a sample post content showing how flexbox can be used in social media layouts...
John Doe
@johndoe
542
Following
1.4k
Followers
302
Posts
Trending
Trending in Tech
#TrendingTopic1
5.2k posts
Trending in Tech
#TrendingTopic2
5.2k posts
Trending in Tech
#TrendingTopic3
5.2k posts
Trending in Tech
#TrendingTopic4
5.2k posts
Trending in Tech
#TrendingTopic5
5.2k posts
CODE
/* Main Layout */
.social-container {
display: flex;
flex-direction: column;
gap: 2rem;
}
@media (min-width: 1024px) {
.social-container {
flex-direction: row;
}
}
/* Main Feed */
.main-feed {
width: 100%;
}
@media (min-width: 1024px) {
.main-feed {
width: 66.666667%;
}
}
/* Post Card */
.post-card {
display: flex;
flex-direction: column;
}
.post-header {
display: flex;
align-items: center;
gap: 1rem;
}
.post-interactions {
display: flex;
gap: 1.5rem;
}
/* Profile Card */
.profile-stats {
display: flex;
justify-content: space-around;
text-align: center;
}