Hello,
I came across some code for a custom section and custom CSS in dawn theme. While it looks good on mobile, I’ve encountered an alignment problem on desktop when changing size. Specifically, the content aligns too far to the left.
My goal is to have it in line with the rest of the elements on the left side of the page. Could you please provide guidance or suggestions to address this issue?
Custom CSS:
.c-menu2 {
display: flex;
overflow-x: auto;
margin-top: 10px;
white-space: nowrap;
align-items: center; /* Align items vertically in the center /
max-width: calc(100% - 40px); / Set maximum width /
margin-left: auto; / Auto left margin /
margin-right: auto; / Auto right margin */
}
.c-menu2 .header__menu-item {
margin-right: 10px;
color: #121212; /* Adjust text color /
text-decoration: none; / Remove underlines from links /
font-size: 14px; / Adjust font size if needed /
font-weight: bold; / Adjust font weight if needed */
}
@media only screen and (max-width: 990px) {
.c-menu2 {
flex-wrap: nowrap;
margin-bottom: 4px;
overflow-x: scroll; /* Allow horizontal scrolling on mobile /
padding: 0 10px; / Add padding to prevent items from being too close to the edge /
max-width: 100%; / Reset max-width for mobile /
justify-content: flex-start; / Align items to the left on mobile /
margin-left: 1px; / Adjust left margin for mobile /
margin-right: 1px; / Adjust right margin for mobile */
}
}
@media only screen and (min-width: 990px) {
.c-menu2 {
justify-content: flex-start; /* Align items to the left on desktop /
margin-left: 20px; / Adjust left margin for desktop /
margin-right: auto; / Reset right margin for desktop /
max-width: 1000px; / Limit the maximum width on larger screens /
width: 100%; / Set width to 100% /
overflow: hidden; / Hide overflow */
}
}
Custom LIQUID:
}
.c-menu2 {
;
align-items: center;
/*display: none; */
}
}
Best regards,
Bero





