This topic has 24 replies, 3 voices, and was last updated 5 years, 3 months ago ago by Rose Tyler
Hello
I would like to enable a border around products. This is because some products on the site have a white background, and some don’t, so it would be good to allow the products to have a clearly defined border around them, so they look more uniform.
I think this was a suggestion made a year or two ago, but I can’t find any setting that turns borders on and off in the theme options. If there is one, please let me know, else what is the code to achieve this via custom ccs?
Regards
Hello,
.content-product .product-content-image img {
border: 1px solid #e1e1e1;
}
Regards
Hi
Thanks for your reply. But the solution not changing anything, even after refreshing bowser cache and CDN cache.
I even changed it to add the !important attribute, but no change:
content-product .product-content-image img {
border: 1px solid #e1e1e1 !important;
}
Regards
Please provide your site URL so I can take a closer look.
Make sure that you added the code correctly – https://prnt.sc/mbeyc3
Regards
Please see private content for login details to staging site. I changed the border colour to red to make it show up, but no change.
Arrrgh! yes, just noticed your screenshot, I missed out the dot. It’s working now. Sorry for the confusion. I had copied and pasted your code into Dreamweaver and missed out the dot somehow. LOL.
Your chosen shade of grey works very well.
Many thanks! 🙂
You’re welcome!
Have a nice day.
Regards
Sorry, I just noticed that the border is showing up on Home page and the Shop page, but not on the product page. Please can you advise how to fix that?
Please change the previous code to:
.content-product .product-content-image img,
.single-product .main-images a img {
border: 1px solid #e1e1e1;
}
Regards
Thanks
That works for the main large image of the product on the single product page, but not other thumbnails on the same page.
For example, in the widget area “Single product page Sidebar’, I added the 8Theme Products Widget. This displays some product thumbnails in the sidebar. These do not have a border. See screenshot:
Also, if a product has multiple images, the small thumbnails underneath the main large image also do not have a border.
.content-product .product-content-image img,
.single-product .main-images a img,
.sidebar-widget .products-widget-slider img,
.single-product .swipers-couple-wrapper .swiper-wrapper img {
border: 1px solid #e1e1e1;
}
.single-product .swipers-couple-wrapper .swiper-wrapper img {
margin-top: 3px;
margin-bottom: 3px;
}
.single-product .swiper-container-autoheight .swiper-wrapper {
padding-bottom: 6px;
}
Regards
Thanks. On first look, it appeared to work. However, when I added extra images to a product to see how the thumbnails underneath were displayed, it caused the right hand border of the main image to initially be displayed when the page was loading, but when all other elements of the page loaded the right-hand border of the main large image disappeared. Also one of the small thumbnails underneath has one side of the border missing too.
This happens on Google Chrome on a 1920×1080 monitor, with the browser maximised. When I make the browser screen smaller, it re-adjusts and then displays the borders as they should be displayed. This seems weird. Not sure why this is happening???
please see the screenshot:
Please can you investigate, seems like a bug? See private content for link to product page.
Hello,
We have improved the code on your site. Correct one is
.content-product .product-content-image, .sidebar-widget .products-widget-slider a.product-list-image, .single-product .swipers-couple-wrapper .swiper-wrapper .woocommerce-main-image, .single-product .thumbnails-list .swiper-slide a {
border: 1px solid #ff0000;
}
Clear CDN cache to apply changes.
Regards
Thanks. I’m still having the problem with the right-hand border not always displaying, as mentioned in my previous post. Please see screenshot in the previous post.
Note – I did refresh browser and CDN cache.
Please clear cache and check one more time.
Regards
Hello Rose
The fix worked on the staging site that I use for testing updates before using them on my live sites, but has not worked on the live site its intended for. The site it worked on was the login details I provided you, not my actual site.
Was there something else you did on my test site to fix that other than the code you provided above? The custom css is the same for both and browser/CDNcache refreshed for both sites, but fix only works on one site. I am confused, unless there is something you did I am not yet aware of?
Hello,
Yes, please check code in Appearance > Customize > Additional css area.
Regards
Thank you for that. Using the code found there in the other site fixed the problems on the single product page.
Going back to the Home Page, I have noticed one last place that borders are not quite correct. The area displaying ‘Best Sellers’ is missing the bottom border. See screenshot:
The other sections of the Home Page appear to be displaying the border correctly for products, it’s just this remaining section.
Also, the code you mentioned on “Appearance > Customize > Additional css area”… can that code be placed in custom css with the other code? Not sure why its there?
Please tell me, are these border problems something you consider an issue that will be resolved in the next theme update?
We added some code to WP custom CSS because we can’t see our changes because of the CDN on your site if we use Theme Options custom CSS area (file with the custom styles is cached, inline WP styles are not cached).
We changed the code in Theme Options, check again. Could you also disable the CDN for the dev site?
Regards
Hi
To both Olga and Rose…. thanks for explaining and thanks for your patience with this issue. The CDN is Cloudflare and I think it definitely causes problems with WordPress. As you suggested, I disabled Cloudflare caching temporarily, deleted browser cache and this fixed the issue for both the live site and dev sites. I have now re-enabled Cloudflare caching and both sites are still working, so i think its fixed. If ever I get problems with appearance not looking how it should, I will from now on remember the Cloudflare issue. Cloudflare has a button to clear cache, which did not appear to work fully. Some things seemed to change, like changes in colour of borders, but not other changes. Very weird.
Thanks for all your help.
The issue related to '‘XStore – How to put a thin grey border around products please?’' has been successfully resolved, and the topic is now closed for further responses