- This topic has 29 replies, 4 voices, and was last updated 3 years, 7 months ago by Leo.
-
AuthorPosts
-
September 14, 2020 at 9:21 am #1442849Ashish
That did not add the borders I was looking for. Added -> padding: 0.5em; to the code and it seems to work in the desktop view. But the borders stick for the tab and mobile view. Also, the Category Title is out of the box. I want to get it in the box.
.category-item img {
border: 1px solid #ddd;
margin-bottom: 5px;
padding: 0.5em;
}Page link: https://hetalkamdar.com/recipes-index-gui/
September 14, 2020 at 2:04 pm #1443230TomLead DeveloperLead DeveloperWhat do you mean by “the borders stick”? I’m not seeing anything obvious.
Do you want the category title to be in its own box?
September 14, 2020 at 6:44 pm #1443396AshishIn the Categories – the ones that are retrieved from the short code, if there are 3 columns, the border between the images are sticking. I need a small gap between these borders. The borders are working perfectly when using ShowPosts below in “Street Food”. (See image below)
Yes. Category title to be in its own box. Currently, it is out of the box below the image.
September 15, 2020 at 3:31 am #1443813DavidStaffCustomer SupportTry updating your CSS to this:
.category-item { padding: 10px; width: calc(33% - 15px); box-sizing: border-box; text-align: center; margin-left: 10px; } .category-grid { display: flex; flex-wrap: wrap; margin-left: -10px; }
September 15, 2020 at 4:41 am #1443907AshishThat worked well. Now the box can be seen with the borders in all the 3 modes.
The title of the Image still needs to be within the box. Please help with that. Thanks a ton.
AshishSeptember 15, 2020 at 6:16 am #1444012DavidStaffCustomer SupportYou can change the font-size using this CSS:
@media(max-width: 600px) { .category-item h5 { font-size: 14px; /* adjust size to suit */ word-wrap: normal; } }
Overall the issue you will have is that the smaller mobile devices aren’t wide enough for 3 columns. A 2 column option would remove a lot of these problems.
September 15, 2020 at 8:48 am #1444416Ashishyou’re absolutely correct David regarding having just 2 columns for smaller devices. How do I do that in this case?
September 15, 2020 at 9:01 am #1444432LeoStaffCustomer SupportMaybe try something like this?
@media (max-width: 768px) { .category-item { width: calc(50% - 15px); } }
September 15, 2020 at 8:47 pm #1445077AshishWorks like a charm now Leo. It’s perfect now. Thank you Leo, David, and Tom for all the help here.
September 15, 2020 at 9:27 pm #1445095AshishJust overlooked the title that’s not appearing within the box. Can You please help me with that last bit here? Thanks so much.
https://hetalkamdar.com/recipes-index-gui/September 16, 2020 at 7:51 am #1445889LeoStaffCustomer SupportTry changing this:
.category-item img { border: 1px solid #ddd; margin-bottom: 5px; padding: .5em; }
to this:
.category-item { border: 1px solid #000; }
September 16, 2020 at 12:01 pm #1446248Ashishthat took the title inside but the padding on the top and bottom is gone.
September 16, 2020 at 1:35 pm #1446324LeoStaffCustomer SupportHave you tried playing around with the margin property in your existing CSS here?
.category-item { padding: 10px; width: calc(33% - 15px); box-sizing: border-box; text-align: center; margin-left: 10px; }
September 16, 2020 at 8:30 pm #1446585AshishYes Leo, that did the trick. Thank you for the hint. You guys are awesome and Im so glad to choose GeneratePress.
September 17, 2020 at 8:02 am #1447323LeoStaffCustomer SupportNo problem 🙂
-
AuthorPosts
- The topic ‘Category Page’ is closed to new replies.