Border in custom lightbox
goldeneye99
Registered Users Posts: 45 Big grins
I've customized my Lightbox view to put a border around my images but for some reason the border isn't right against the image on 2 of the sides (for a landscape image there is a black border on the left and right, and for a vertical on the top and bottom).
Example here:
http://goldeneye99.smugmug.com/Other/Falkland-Islands/i-C9Ggr7L/A
The code that I think might be needing editing is as follows:
/* reduce the size of the image in lightbox */
.sm-lightbox-image {
border: 30px solid #333333;
-webkit-transform: scale(0.8);
-moz-transform: scale(0.8);
-ms-transform: scale(0.8);
transform: scale(0.8);
-webkit-backface-visibility: hidden;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
background-repeat: no-repeat;
background-position: center center;
background-size: contain !important;
}
Thanks,
Nigel
www.nigelrobertsphotography.com
Example here:
http://goldeneye99.smugmug.com/Other/Falkland-Islands/i-C9Ggr7L/A
The code that I think might be needing editing is as follows:
/* reduce the size of the image in lightbox */
.sm-lightbox-image {
border: 30px solid #333333;
-webkit-transform: scale(0.8);
-moz-transform: scale(0.8);
-ms-transform: scale(0.8);
transform: scale(0.8);
-webkit-backface-visibility: hidden;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
background-repeat: no-repeat;
background-position: center center;
background-size: contain !important;
}
Thanks,
Nigel
www.nigelrobertsphotography.com
0
Comments
I added that code to my site and it worked for me.
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
For example if you have an image on 1000x600 and you want to have a border of 10% then you get 60px on the top/bottom border but 100px on the left/right border. If you then create a border with 60px of solid #333333 you would see black margins of 40px on the left and right.
What about this:
http://goldeneye99.smugmug.com/Other/Falkland-Islands/i-C9Ggr7L/A
Can you try this new code? It should center the photo on the y-axis also (make sure to remove all old code):
I applied the code to my site and it looks ok. Can you check that it looks on your device good also? If so the code seem to work and maybe you have some other code on your site that causing some trouble.
I added my code from post #10 using chrome webtools and everything seem to be fine.
Does it work for you now?
P.S. Ahh.. ok, thx for the feedback.
For the homepage slideshow i'm using a code provided by some nice user from dgrin... let me check if i could apply that to your site...
Wondering if I could do something similar for homepage slideshow?
P.S.
On my browser i get a scrollbar on the right... useless on your homepage. Not sure if it helps, maybe worth a try (CSS box on homepage only):
P.S. I really like your penguin shots from falkland islands... great work!
I just updated the code... here is what i have added for testing on homepage slideshow, lightbox slideshow and lightbox image. Everywhere i got a scaled down photo with a border around it. Tested on FireFox only because i have no chrome or IE here right now.
The red part of the following code might not be neccessary if you replace all existing code...
I tried the code in your last post on my site and it works great in most cases, really love those borders. The problems I notice is that the lower border gets cut-off partly by the caption/title box at the bottom of the page in teh full image view, and also that in the smugmug gallery style there are no borders on the right hand big photo. If it is possible to get these things to work also it would be fantastic!
Christer W
www.christerwe.com
Ohh I realize that the first problem only seems to happen when I'm logged in, not otherwise. So no need to put any effort into solving that But still wonder how to get borders onto the smugmug style gallery main image.
Christer W