Viewing 16 posts - 1 through 16 (of 16 total)
  • Author
    Posts
  • #1010711

    Hi.
    I need to create border around the product image in the product page.
    At the moment, this code create border bigger than the image size.

    .woocommerce .product img {
    border: 1px solid black;
    }

    How can I create border fit to the image size and align border and image to the center ?

    Thanks for your support.

    Kind regards.

    #1010776

    Also please check this sample image to understand our problem better.

    https://cdn1.imggmi.com/uploads/2018/9/17/6c939207cf6edd304056bd998ae11049-full.png

    Thanks so much for your help.

    #1010860

    Hi WebManager11,

    Could you please give us a link to your website, we need more context to be able to help you.

    Best regards,
    Victoria

    #1010898
    This reply has been marked as private.
    #1010914

    Hi WebManager11,

    Please remove the code you added before.

    Here is the code you can put in Enfold > General Styling > Quick Css,  if it does not work, put into themes/enfold/css/custom.css

    
    #top .product div.images img {
        border: 1px #000 solid;
    }
    

    If you need further assistance please let us know.

    Best regards,
    Victoria

    #1010922

    Can you check the link again ?
    It changed the border but it have double line borders instead of single line border.

    #1010924

    Also It seems the image size is greater than the actual image size 300×300. How can I show the original image size 300 x 300 in the product page ?

    You can click on the image and you will see that image size is actually smaller.

    • This reply was modified 6 years, 3 months ago by WebManager11.
    #1011030

    Hello
    Can you please help ?

    #1011080

    Hi,

    Thanks for the update, let’s stick to one problem at a time. Please try this for the border:

    .template-shop .single-product-main-image .images a {
        border: none;
    }

    Best regards,
    Rikard

    #1011410

    This code remove border but the image size is too big and just blury.

    .template-shop .single-product-main-image .images a {
    border: none;
    }

    #1011411

    I have put it back this code because this code is slightly better than your code. But still the image is blury because image size is bigger than the original size.

    #top .product div.images img {
    border: 1px #000 solid;
    }

    • This reply was modified 6 years, 3 months ago by WebManager11.
    #1011417

    If I put this code then the image size is correct. But border is too wider than the image size. Check this sample image.

    https://cdn1.imggmi.com/uploads/2018/9/17/6c939207cf6edd304056bd998ae11049-full.png

    I need to know what is the right css code for my problem.

    #top .product div.images img {
    width: 300px !important;
    max-width: 300px !important;
    margin-left: auto;
    margin-right: auto;
    }

    #1011960

    Not sure if one can sugget some alternative code ??

    Or do you want me to create new post ?

    #1012282

    Hi,

    Have you tried to limit the size of the main image container?

    .single-product-main-image {
        width: 23%;
    }

    Default width value is 33%.

    Best regards,
    Ismael

    #1012435

    Good solution from unexpected angle. That really worked.
    Thanks so much.

    #1012501

    Hi,

    I’m glad you got that resolved. If you need additional help, please let us know here in the forums.

    Best regards,
    Jordan Shannon

Viewing 16 posts - 1 through 16 (of 16 total)
  • The topic ‘Woocommerce Product Page Border Creation + Aligning image and border to center’ is closed to new replies.