Home › Forums › Support › List Subcategory Code / CSS This topic has 5 replies, 2 voices, and was last updated 3 years, 2 months ago by David. Viewing 6 posts - 1 through 6 (of 6 total) Author Posts January 12, 2023 at 3:09 am #2492594 Scott Hello! i implemented the code here (https://generatepress.com/forums/topic/show-list-sub-category-in-category-page/) to show sub categories on my category page. Used this CSS to style as buttons: .gb-container .list-subcats {list-style:none; display:flex;justify-content:space-around} .gb-container .list-subcats li a {color:#607e26;background-color:#fffcec;padding:10px 25px; border:1px #71942c solid; border-radius:25px;} @media (max-width:800px) {.gb-container .list-subcats {flex-direction:column;text-align:center;}} @media (max-width:800px) {.gb-container .list-subcats li{flex-direction:column;text-align:center;margin:15px 20px}} Is there a way to limit the number of flex columns? Buttons are getting split in two on the category pages with more than four subcategories. I want to limit it to 4 per line (4 columns per line on desktop)? Link and example photo below. THANKS! January 12, 2023 at 7:42 am #2492831 DavidStaff Customer Support Hi there, look for this CSS: .gb-container .list-subcats { list-style: none; display: flex; justify-content: space-around; } and replace it with: .gb-container .list-subcats { list-style: none; display: flex; flex-wrap: wrap; } This will make flex wrap so it creates extra rows when it runs out of space. Then add this CSS if to put some space between them: .gb-container .list-subcats li { display: block; margin: 20px 5px; } January 12, 2023 at 7:57 am #2493020 Scott Much better – how can I center the entire container? tried the tricks I knew – none of which worked. THANKS! January 12, 2023 at 9:17 am #2493144 DavidStaff Customer Support Try adding justify-content: center; to this CSS: .gb-container .list-subcats { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; } January 15, 2023 at 6:10 am #2496132 Scott Perfect – thanks January 15, 2023 at 6:50 am #2496154 DavidStaff Customer Support You’re welcome Author Posts Viewing 6 posts - 1 through 6 (of 6 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In