Items are not aligned in the center - css

enter image description here
i am trying to align all the .features items in the center but for some reason only the first one is doing it. I do not find the reason, please help.
<section>
<div class="features">
<div><i class="fa-solid fa-fire"></i></div>
<div>
<h2>Premium Materials</h2>
<p class="p-description">
Our guitars are built with the best amazonian wood
</p>
</div>
</div>
<div class="features">
<div>
<i class="fa-solid fa-truck-fast"></i>
</div>
<div>
<h2>Shipping</h2>
<p class="p-description">
We make sure you recieve your trombone as soon as we have finished
making it. We also provide free returns if you are not satisfied.
</p>
</div>
</div>
<div class="features">
<div><i class="fa-solid fa-user-check"></i></div>
<div>
<h2>Satisfaction</h2>
<p class="p-description">
For every purchase you make, we will ensure there are no damages or
faults and we will check and test the quality of your instrument.
</p>
</div>
</div>
</section>
css
body {
background-color: #eff1ed;
font-family: "Roboto", sans-serif;
}
/* Header and nav bar */
header {
display: flex;
}
.logo-guitar {
padding: 2% 1% 3% 2%;
}
.luthier-name {
width: 100%;
padding: 1.5% 0 0 1%;
}
#nav-bar {
display: flex;
text-align: center;
justify-content: space-between;
flex-direction: row;
}
.nav-link {
width: 94px;
text-align: center;
margin: 2px auto;
padding-top: 15%;
color: #131b23;
text-decoration: none;
font-weight: bold;
}
h1 {
font-family: "Satisfy", cursive;
font-size: 3rem;
}
/* email form */
.email-form {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
}
#email {
height: 25px;
width: 100%;
}
#submit {
width: 80%;
margin-top: 5%;
background-color: #ffe121;
border: 0;
font-weight: bold;
height: 35px;
font-family: inherit;
font-size: large;
}
/* Features */
.fa-solid {
color: #e3170a;
font-size: 50px;
}
.features {
display: flex;
align-items: center;
justify-content: center;
text-align: left;
}
.p-description {
width: 80%;
}
section {
padding-top: 10%;
}
If all them have the same class i do not understan why this is happening. I was trying to uso console to find the reason but i'm stuck.

It seems that the .p-description has a width based on its content (it is set in percentage, but its container also does not have a defined width), therefore it gets wider with more text inside, which result in unexpected different looks.
You can define width of .p-description with a value independent to its content and it should make them have same width, such as in px, em, vw, or vh.
Example:
.p-description {
max-width: 350px;
}
Or the layout of its container and parent container can be adjusted to properly contain various length of content in .p-description, but it does take a bit more of refactoring.
Hope that it helps!

Related

How can i center the text if the fantawesome icon has a different size than the two below?

enter image description here
As you guys can see, i centered the items but due to the first one is a little bit smaller the title and text on the right is not aligned with the two bellow. I could add some padding to center it manually but im not sure if that is a good practice, and also if it is going to affect the order when i add the media query to make it responsive and all of that.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v6.1.0/css/all.css">
<style>
body {
background-color: #eff1ed;
font-family: "Roboto", sans-serif;
}
/* Header and nav bar */
header {
display: flex;
}
.logo-guitar {
padding: 2% 1% 3% 2%;
}
.luthier-name {
width: 100%;
padding: 1.5% 0 0 1%;
}
#nav-bar {
display: flex;
text-align: center;
justify-content: space-between;
flex-direction: row;
}
.nav-link {
width: 94px;
text-align: center;
margin: 2px auto;
padding-top: 15%;
color: #131b23;
text-decoration: none;
font-weight: bold;
}
h1 {
font-family: "Satisfy", cursive;
font-size: 3rem;
}
/* email form */
.email-form {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
}
#email {
height: 25px;
width: 100%;
}
#submit {
width: 80%;
margin-top: 5%;
background-color: #ffe121;
border: 0;
font-weight: bold;
height: 35px;
font-family: inherit;
font-size: large;
}
/* Features */
.fa-solid {
color: #e3170a;
font-size: 4rem;
}
.features {
display: flex;
align-items: center;
justify-content: center;
text-align: left;
}
.p-description {
max-width: 90vh;
}
section {
padding-top: 10%;
}
.icon {
padding-right: 3%;
}
</style>
</head>
<body>
<section>
<div class="features">
<div class="icon"><i class="fa-solid fa-fire"></i></div>
<div>
<h2>Premium Materials</h2>
<p class="p-description">
Our guitars are built with the best amazonian wood. This will
increase the longevity of your purchase.
</p>
</div>
</div>
<div class="features">
<div class="icon">
<i class="fa-solid fa-truck-fast"></i>
</div>
<div>
<h2>Shipping</h2>
<p class="p-description">
We make sure you recieve your trombone as soon as we have finished
making it. We also provide free returns if you are not satisfied.
</p>
</div>
</div>
<div class="features">
<div class="icon"><i class="fa-solid fa-user-check"></i></div>
<div>
<h2>Satisfaction</h2>
<p class="p-description">
For every purchase you make, we will ensure there are no damages or
faults and we will check and test the quality of your instrument.
</p>
</div>
</div>
</section>
</body>
</html>
I would like to know whats the best option in these cases.
Try using fixed-width Fontawesome icons by adding fa-fw to the classes (see https://fontawesome.com/docs/web/style/fixed-width). For instance:
<i class="fa-solid fa-fire fa-fw"></i>

CSS Flex and transformed text

I am trying to get this kind of effect to display a date
I am using flex and text transform, but am struggling to get it right. I cannot get rid of the extra width to the right of the year.
This is my current result.
Here is my code:
.event {
display: flex;
gap: 20px;
margin-bottom: 5px;
}
.date {
border-radius: 5px;
letter-spacing: 1.2px;
background-color: #f6f5f0;
color: #d8d6c8;
padding: 5px;
}
.date .dayAndMonth {
display: inline-block;
}
.date .month {
text-align: center;
font-size: 13px;
}
.date .day {
text-align: center
}
.date .year {
display: inline-block;
transform-origin: 0 0;
transform: rotate(-90deg);
position: relative;
top: 18px;
}
.event_details {}
<article class="event">
<div class="date">
<div class="dayAndMonth">
<div class="month">Feb</div>
<div class="day">04</div>
</div>
<div class="year">2022</div>
</div>
<div class="event_details">
<div class="title">Event Title</div>
</div>
</article>
I would recommend to use writing-mode: vertical-lr; for more details
.event {
display: flex;
gap: 20px;
margin-bottom: 5px;
}
.date {
border-radius: 5px;
letter-spacing: 1.2px;
background-color: #f6f5f0;
color: #d8d6c8;
padding: 5px;
/*Added css*/
display: flex;
align-items: center;
}
.date .dayAndMonth {
display: inline-block;
}
.date .month {
text-align: center;
font-size: 13px;
}
.date .day {
text-align: center;
}
.date .year {
display: inline-block;
writing-mode: vertical-lr; // use this css
position: relative;
}
.event_details {}
<article class="event">
<div class="date">
<div class="dayAndMonth">
<div class="month">Feb</div>
<div class="day">04</div>
</div>
<div class="year">2022</div>
</div>
<div class="event_details">
<div class="title">Event Title</div>
</div>
</article>
It's because of position relative that anchors .year in the .date container. It will still take space there as it is relative to that position making the container adjust it's dimension to accommodate the .year. There're two ways that I can think of. First, is fix the dimensions of .date: height and width then reposition the right and top of the .year. Or you could just use position: absolute; on .year, just set the parent container's width: 50; and adjust the top property to reposition. See the snippet below:
*{
box-sizing: border-box;
margin: 0;
padding: 0;
}
.event {
display: flex;
gap: 20px;
margin-bottom: 5px;
padding: 1rem;
}
.date {
border-radius: 5px;
letter-spacing: 1.2px;
background-color: #f6f5f0;
color: #d8d6c8;
padding: 5px;
width: 50px;
}
.date .dayAndMonth {
display: inline-block;
}
.date .month {
text-align: center;
font-size: 13px;
}
.date .day {
text-align: center
}
.date .year {
display: inline-block;
transform-origin: 0 0;
transform: rotate(-90deg);
position: absolute;
top: 55px;
}
.event_details {}
<article class="event">
<div class="date">
<div class="dayAndMonth">
<div class="month">Feb</div>
<div class="day">04</div>
</div>
<div class="year">2022</div>
</div>
<div class="event_details">
<div class="title">Event Title</div>
</div>
</article>
More on positions here.
Solution
Add a value for width to .year in your CSS. That is
.date .year {
/* ... (other styles) */
width: 20px; /* newly added value for width */
}
Explanation
On rendering your HTML/CSS code, the browser kind of calculates the widths of elements. At this point, the width of the .year div (containing 2022) has been set. After the rotation is rendered, the width was still retained hence the extra space at the right.
So explicitly setting the width removes the extra space to the right of the vertical 2022.
Note
You may want to set the font sizes of .month, .day, and .year to be sure that their values are not distorted or superimposed on each other when your page is rendered in a browser where the user has scaled up font sizes.

trying to center .follow-btn using justify-content:center; [duplicate]

This question already has answers here:
In CSS Flexbox, why are there no "justify-items" and "justify-self" properties?
(6 answers)
Closed 2 years ago.
<style>
body {
font-family: Arial, sans-serif;
}
header, footer {
display: flex;
flex-direction: row;
}
header .profile-thumbnail {
width: 50px;
height: 50px;
border-radius: 4px;
}
header .profile-name {
display: flex;
flex-direction: column;
justify-content: center;
margin-left: 10px;
}
header .follow-btn {
display: flex;
justify-content:center;
margin: 0 0 0 auto;
}
header .follow-btn button {
border: 0;
border-radius: 3px;
padding: 5px;
}
header h3, header h4 {
display: flex;
margin: 0;
}
#inner p {
margin-bottom: 10px;
font-size: 20px;
}
#inner hr {
margin: 20px 0;
border-style: solid;
opacity: 0.1;
}
footer .stats {
display: flex;
font-size: 15px;
}
footer .stats strong {
font-size: 18px;
}
footer .stats .likes {
margin-left: 10px;
}
footer .cta {
margin-left: auto;
}
footer .cta button {
border: 0;
background: transparent;
}
</style>
<header>
<img src="https://freecodecamp.s3.amazonaws.com/quincy-twitter-photo.jpg" alt="Quincy Larson's profile picture" class="profile-thumbnail">
<div class="profile-name">
<h3>Quincy Larson</h3>
<h4>#ossia</h4>
</div>
<div class="follow-btn">
<button>Follow</button>
</div>
</header>
<div id="inner">
<p>I meet so many people who are in search of that one trick that will help them work smart. Even if you work smart, you still have to work hard.</p>
<span class="date">1:32 PM - 12 Jan 2018</span>
<hr>
</div>
<footer>
<div class="stats">
<div class="Retweets">
<strong>107</strong> Retweets
</div>
<div class="likes">
<strong>431</strong> Likes
</div>
</div>
<div class="cta">
<button class="share-btn">Share</button>
<button class="retweet-btn">Retweet</button>
<button class="like-btn">Like</button>
</div>
</footer>
So my question is, before I add Justify-content:center; to header .follow-btn, the button remains ont he left, if I add any justify type of data to this it goes to the right. Wether I use center or whatever. My question is Why?. I'm trying to learn the basics and this is a bit confusing considering I just finished the course stating that justify content center should push it to the middle of the x axis, but isn't.
You are having: margin: 0 0 0 auto; into header .follow-btn that will align your button to the right because it will add a full margin to the left no matter what as your header is set with display:flex;.
Make margin like: margin: auto 0; if you want to align it horizontaly.
<style>
body {
font-family: Arial, sans-serif;
}
header, footer {
display: flex;
flex-direction: row;
}
header .profile-thumbnail {
width: 50px;
height: 50px;
border-radius: 4px;
}
header .profile-name {
display: flex;
flex-direction: column;
justify-content: center;
margin-left: 10px;
}
header .follow-btn {
display: flex;
justify-content:center;
margin: auto 0;
padding-left: 10px;
}
header .follow-btn button {
border: 0;
border-radius: 3px;
padding: 5px;
}
header h3, header h4 {
display: flex;
margin: 0;
}
#inner p {
margin-bottom: 10px;
font-size: 20px;
}
#inner hr {
margin: 20px 0;
border-style: solid;
opacity: 0.1;
}
footer .stats {
display: flex;
font-size: 15px;
}
footer .stats strong {
font-size: 18px;
}
footer .stats .likes {
margin-left: 10px;
}
footer .cta {
margin-left: auto;
}
footer .cta button {
border: 0;
background: transparent;
}
</style>
<header>
<img src="https://freecodecamp.s3.amazonaws.com/quincy-twitter-photo.jpg" alt="Quincy Larson's profile picture" class="profile-thumbnail">
<div class="profile-name">
<h3>Quincy Larson</h3>
<h4>#ossia</h4>
</div>
<div class="follow-btn">
<button>Follow</button>
</div>
</header>
<div id="inner">
<p>I meet so many people who are in search of that one trick that will help them work smart. Even if you work smart, you still have to work hard.</p>
<span class="date">1:32 PM - 12 Jan 2018</span>
<hr>
</div>
<footer>
<div class="stats">
<div class="Retweets">
<strong>107</strong> Retweets
</div>
<div class="likes">
<strong>431</strong> Likes
</div>
</div>
<div class="cta">
<button class="share-btn">Share</button>
<button class="retweet-btn">Retweet</button>
<button class="like-btn">Like</button>
</div>
</footer>

Strange inheriting from "a" element in "figure" to "p" element

I have a really weird bug about inheriting in css. p element that is not inside "a" elements block, inheriting "a" element's properties and turning an "a" element strangely.
// !! IMPORTANT README:
// You may add additional external JS and CSS as needed to complete the project, however the current external resource MUST remain in place for the tests to work. BABEL must also be left in place.
/***********
INSTRUCTIONS:
- Select the project you would
like to complete from the dropdown
menu.
- Click the "RUN TESTS" button to
run the tests against the blank
pen.
- Click the "TESTS" button to see
the individual test cases.
(should all be failing at first)
- Start coding! As you fulfill each
test case, you will see them go
from red to green.
- As you start to build out your
project, when tests are failing,
you should get helpful errors
along the way!
************/
// PLEASE NOTE: Adding global style rules using the * selector, or by adding rules to body {..} or html {..}, or to all elements within body or html, i.e. h1 {..}, has the potential to pollute the test suite's CSS. Try adding: * { color: red }, for a quick example!
// Once you have read the above messages, you can delete all comments.
#import url("https://fonts.googleapis.com/css?family=Lato|Roboto");
body {
margin: 0;
}
#navbar {
min-height: 90px;
position: fixed;
top: 0;
left: 0;
right: 0;
display: flex;
justify-content: flex-end;
align-items: center;
background: #303841;
}
#navbar a {
padding: 0 6vw;
text-decoration: none;
font: bold calc(20px + 1vw) "Lato";
color: #f6c90e;
letter-spacing: 2px;
text-shadow: 0 2px 0 black;
}
.container #welcome-section {
background: #303841;
height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.container #welcome-section header {
font-size: calc(20px + 2vw);
font-weight: bold;
font-family: 'Lato';
color: #f6c90e;
letter-spacing: 4px;
text-shadow: 0 2px 0 black;
text-align: center;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.container #welcome-section header p {
margin-top: 0;
color: #eeeeee;
}
.container #welcome-section header h1 {
margin-bottom: 10px;
}
.container #projects {
min-height: 100vh;
display: flex;
align-items: baseline;
justify-content: space-evenly;
flex-wrap: wrap;
background: #3a4750;
}
.container #projects h2 {
flex-basis: 100%;
text-align: center;
font-size: calc(20px + 3vw);
font-weight: bold;
font-family: 'Lato';
color: #eeeeee;
text-decoration: underline;
text-shadow: 0 2px 0 black;
}
.container #projects figure {
width: 35vw;
}
.container #projects figure img {
display: block;
max-width: 100%;
border-radius: 2%;
}
.container #projects figure a {
text-decoration: none;
display: block;
}
.container #projects figure figcaption {
text-align: center;
text-shadow: 0 2px 0 black;
font: bold calc(15px + 1vw) "Roboto";
color: #f6c90e;
}
#media (max-width: 768px) {
#navbar {
justify-content: space-between;
}
#projects > * {
flex-basis: 100%;
padding-bottom: 10px;
}
#projects a {
width: 75%;
margin: 0 auto;
}
}
#media (max-width: 768px) and (max-width: 576px) {
#navbar {
flex-direction: column;
justify-content: space-evenly;
align-items: center;
}
}
<script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
<!-- Navigation bar -->
<nav id="navbar">
About
Work
Contact
</nav>
<!-- Main content -->
<main class="container">
<section id="welcome-section">
<header>
<h1>Anıl Emek Türkeli</h1>
<p>Frontend Developer</p>
</header>
</section>
<section id="projects">
<h2>All Works I've Done So Far </h2>
<figure class="project-tile">
<img src="https://cdn1.imggmi.com/uploads/2019/3/12/f3614255ab87606e66bf5d449e194599-full.png"
<figcaption>Sass Technical Documentation Page</figcaption>
</figure>
<figure class="project-tile">
<img src="https://cdn1.imggmi.com/uploads/2019/3/12/99066cf68f33649bc17562c4925c3afa-full.png"
<figcaption>Repedo Landing Page</figcaption>
</figure>
<figure class="project-tile">
<img src="https://cdn1.imggmi.com/uploads/2019/3/12/626217cf51607a559f6a47fad499f355-full.png"
<figcaption>Repedo Survey Form</figcaption>
</figure>
<figure class="project-tile">
<img src="https://cdn1.imggmi.com/uploads/2019/3/12/1dbdcffbefc68964500597ec04e48e05-full.png"
<figcaption>Mustafa Kemal Atatürk's Tribute Page</figcaption>
</figure>
</section>
<section id="contact">
<p>Deneme</p>
</section>
</main>
https://codepen.io/anilemek/pen/PLjpQm
Can anybody explain why this issue occured?
Thank you.
If it is about the <p> with textDeneme at the bottom of the site, the issue is in the img tags before. You have to close them. So eg,<img src="https://cdn1.imggmi.com/uploads/2019/3/12/626217cf51607a559f6a47fad499f355-full.png"/>

Flexbox: while a group of items is at the very center of the page, put at single item at the bottom

I have used Bootstrap 4 and some custom CSS to make a hero section with all its items but one centered horizontally and vertically.
The exception is one item I want to align at the bottom of the page and still keep it centered horizontally.
html,
body {
padding: 0;
margin: 0;
height: 100%;
}
.page-wrapper {
min-height: 100%;
}
a.inherit {
color: inherit;
}
a.nounderline, a.nounderlie:hover {
text-decoration: none;
}
.page-wrapper {
min-height: 100%;
}
.hero {
height: 100vh;
overflow-y: hidden;
padding-top: 3rem;
padding-bottom: 3rem;
justify-content: center;
align-items: center;
}
.hero img {
width: 100%;
}
.hero.type-text h1 {
color: #000;
}
.hero.hero-short {
max-height: 768px;
}
section.type-text h3 {
font-weight: bold;
font-size: 2rem;
margin-bottom: 0;
}
section.type-text h4 {
font-size: 14px;
font-weight: bold;
margin-bottom: 0;
margin-top: 1.5rem;
}
section.type-text p {
font-weight: 500;
}
.allcases {
text-align: center;
font-weight: 700;
margin-top: auto;
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" rel="stylesheet"/>
<div class="page-wrapper">
<section class="container d-flex hero type-text">
<div>
<h4 class="text-center m-0">Next item</h4>
<h1 class="display-1 text-center">
<a class="inherit nounderlie" href="#">Lorem</a>
</h1>
</div>
<p class="allcases">
<a class="inherit" href="#">See all items</a>
</p>
</section>
</div>
"See all items" does stay to the bottom (thanks to margin-top: auto), but it is not centered. Changing the flex-direction from row to column messes the whole layout so it is not the way to go.
What is viable solution?
You should be using flex-direction: column for this. This is an ideal use-case for it. Using row layout to achieve what you want, i.e. have the items horizontally centered is not viable. You'd be better off not using flex at all, and using margins instead. If you really wish to use flex-direction: row then the only solution I can think of is either to use position: absolute or a negative margin. Wouldn't recommend it though, since what you want can so easily be accomplished just by using flex-direction: column.
Here is the result I achieved just by changing 2 properties.
Update styling to
// Only added flex-direction: column to this
.hero {
height: 100vh;
overflow-y: hidden;
padding-top: 3rem;
padding-bottom: 3rem;
justify-content: center;
align-items: center;
flex-direction: column;
}
// This is to target the first div, i.e. the div that contains next item and Lorem, since the div doesn't have a class.
.hero > div {
margin-top: auto;
}
The answer is rather simple. Change the flex-flow of your container to column.
flex-flow:column;
Now you have two flex-items: The div, containing your Title and the other links and the footer-p. The first trick is to make your div grow, while the p-tag stays the same. So assign
flex: 1 auto;
to your div and
flex: 0 auto;
to your p-tag.
After doing so you have to add
display: flex;
justify-content: center;
flex-flow: column;
to your div, too. Making it a flex-box itself.
Your p-tag doesnt require more attention, you can also remove the unnecessary margins.
This should do the trick.
You need to allow wrapping and set a width to the div suppose to stand at top
to allow wrapping, use a class
<section class="container d-flex hero type-text flex-wrap">
for the di, you can do :
.hero>div {
width:100%;
}
html,
body {
padding: 0;
margin: 0;
height: 100%;
}
.page-wrapper {
min-height: 100%;
}
a.inherit {
color: inherit;
}
a.nounderline, a.nounderlie:hover {
text-decoration: none;
}
.hero {
height: 100vh;
overflow-y: hidden;
padding-top: 3rem;
padding-bottom: 3rem;
justify-content: center;
align-items: center;
}
.hero>div {
width:100%;
}
.hero img {
width: 100%;
}
.hero.type-text h1 {
color: #000;
}
.hero.hero-short {
max-height: 768px;
}
section.type-text h3 {
font-weight: bold;
font-size: 2rem;
margin-bottom: 0;
}
section.type-text h4 {
font-size: 14px;
font-weight: bold;
margin-bottom: 0;
margin-top: 1.5rem;
}
section.type-text p {
font-weight: 500;
}
.allcases {
text-align: center;
font-weight: 700;
margin: auto auto 0 auto;
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" rel="stylesheet"/>
<div class="page-wrapper">
<section class="container d-flex hero type-text flex-wrap">
<div>
<h4 class="text-center m-0">Next item</h4>
<h1 class="display-1 text-center">
<a class="inherit nounderlie" href="#">Lorem</a>
</h1>
</div>
<p class="allcases">
<a class="inherit" href="#">See all items</a>
</p>
</section>
</div>
Another option is to use the flex-column class
html,
body {
padding: 0;
margin: 0;
height: 100%;
}
.page-wrapper {
min-height: 100%;
}
a.inherit {
color: inherit;
}
a.nounderline, a.nounderlie:hover {
text-decoration: none;
}
.hero {
height: 100vh;
overflow-y: hidden;
padding-top: 3rem;
padding-bottom: 3rem;
justify-content: center;
align-items: center;
}
.hero img {
width: 100%;
}
.hero.type-text h1 {
color: #000;
}
.hero.hero-short {
max-height: 768px;
}
section.type-text h3 {
font-weight: bold;
font-size: 2rem;
margin-bottom: 0;
}
section.type-text h4 {
font-size: 14px;
font-weight: bold;
margin-bottom: 0;
margin-top: 1.5rem;
}
section.type-text p {
font-weight: 500;
}
.allcases {
text-align: center;
font-weight: 700;
margin: auto auto 0 auto;
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" rel="stylesheet"/>
<div class="page-wrapper">
<section class="container d-flex flex-column hero type-text ">
<div>
<h4 class="text-center m-0">Next item</h4>
<h1 class="display-1 text-center">
<a class="inherit nounderlie" href="#">Lorem</a>
</h1>
</div>
<p class="allcases">
<a class="inherit" href="#">See all items</a>
</p>
</section>
</div>
in both example, margin of allcases is reset to :
margin: auto auto 0 auto;
to stick it at bottom of container, no matter the flex-direction.

Resources