Good morning. I have problem with flex container. Basically the width for mobile users is shorter than desktop users. I tried use align commands and position of content/text but if i change position and add width to content then its not centered anymore for mobile users. Just for desktop.
Whatever im trying to align on desktop then it won't be align for mobile users. Is there a way to go around it?
Thanks.
Here is my HTML AND CSS CODES
HTML
<div class="add-to-cart-btn pa"><a href="/collections/something-here" class="" aria-label="Select options" rel="nofollow"><i class="icon-options-vertical icons"></i></a></div>
CSS
.add-to-cart-btn>a>i {
opacity: 0.5;
font-size: 80%;
padding-top: 3px;
}
.add-to-cart-btn>a {
background-color: #f76b6a;
color: #fff;
font-size: 18px;
text-align: center;
line-height: 20px;;
display: flex;
justify-content: center;
}
.add-to-cart-btn>a::after {
content: attr(aria-label);
text-align: center;
font-size: 14px;
color: white;
}
This is how it looks on desktop but on mobile it is shorter for about 20px