How to Customize Blogger's Lightbox

For those of you who have chosen to use the Blogger's Lightbox View for displaying pictures when clicking on them, you have the option to change its style in a whole different way. You will be able to change the black color of the screen, the border or shadow of the images and the color of the thumbnails background. We can customize the Blogger Lightbox entirely on our taste.

blogger lightbox, change blogger lightbox
Demo

Take a look at the screenshots below:

Before:

customize blogger lightbox, blogger lightbox

After:

blogger lightbox, change lightbox background

After adding our CSS code, the entire look of the modal window will be changed: the background color, the bar showing the thumbnails, the border of images, the text within it, transparency and the close button.

blogger lightbox, modify lightbox, blogger tutorials

All we have to do is to overwrite the default styles and change them with ours.

How to Change the Blogger's Lightbox Background and Style

Step 1. Go to Template, click on the Edit HTML button (also click on the Proceed button if needed)


Step 2. Click anywhere inside the code area and search using CTRL + F the following tag:
</head>
Step 3. Just above the </head> tag, add the following code:
<style>
/* Background Color */
.CSS_LIGHTBOX_BG_MASK {
background-color: #ffffff !important;
background-image: url(image-url-address) !important;
opacity: 0.8 !important;
filter: alpha(opacity=90) !important;
}
/* Images Border */
.CSS_LIGHTBOX_SCALED_IMAGE_IMG {
outline: 0px solid #fff !important;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
-webkit-box-shadow: 0px 0px 5px #000000;
-moz-box-shadow: 0px 0px 5px #000000;
box-shadow: 0px 0px 5px #000000;
}
/* Close Button */
.CSS_LIGHTBOX_BTN_CLOSE {
background: url(image-url) no-repeat !important;
width: 24px !important;
height: 24px !important;
}
/* Thumbnails Bar Color */
.CSS_LIGHTBOX_FILMSTRIP {
background-color: #eaeaea !important;
}
/* Text Color */
.CSS_LIGHTBOX_ATTRIBUTION_INFO, .CSS_LIGHTBOX_ATTRIBUTION_LINK {
color: #000 !important;
}
/* Index Info (number of images) */
.CSS_LIGHTBOX_INDEX_INFO {
color: #555555 !important;
}
</style>

Note:
- The text in green explains to which part the code belongs to and it doesn't need to be modified

For example, the portion below / * Background Color * / can change the background color or even the LightBox background color with an image - for this, change this line by replacing the red text with the url address of your image:
background-image: url(image-url) !important;
- Below is the opacity: if you add a lower value ( 0.8 ) the background will become more transparent.

- To change the icon for the close button, you have to replace the text in red from /* Close Button */ with the URL of your image. (you can host image at tinypic or upload it into a blogger draft and then Copy the Link Location - read this tutorial for more info)
- To change the text color of images, replace the #555555 value from /* Index Info (number of images) */

- We can also change the look of the border around our pictures like we can make them more round, add a shadow, etc... but remember this is CSS3 and older versions of Internet Explorer will not show any changes.

Step 4. Click on Save Template and you're done!

10 comments:

  1. nice tutorials ..can you tell me how to add facebook like box to blogger.

    ReplyDelete
  2. Hi!
    I was very happy with my beautiful new lightbox for a while. But for a few weeks now it doesn't work. On click, the image opens at its webadress. I tried in Google chrome, IE and M. Firefox.
    The lightbox doesn't work anymore.
    Could You help? I really want it back.
    My blog is: http://comoridelicioase.blogspot.ro/
    Thank You very much.

    ReplyDelete
    Replies
    1. Hi Rita,

      You should wait until the page has finished loading because the browser tries to read the style meanwhile. Please re-check it again, it works fine from here.

      Thanks for the visit!

      Delete
  3. Everything works great except for the fact that the close button can't be seen once the Lightbox is in use. Any suggestions??

    ReplyDelete
  4. Nice tip! I loved it!
    But, i have a question. Is possible hide an image in lightbox?
    I use the tip for hide/show widgets/gadgets to hide an image inside the post, and work very well. But... in the lightbox the hidden image appear normally! Any sugestion?

    ReplyDelete
  5. Can you add jquery effect for this?

    ReplyDelete
  6. nice share, i'will try, and i have see the demo on your blog right ?

    Can you add button share or another link when lightbox active ?

    btw great thanks post this post :)

    ReplyDelete
  7. Hi,

    I'm trying insert caption(s) in my lightbox; Any suggestions?

    ReplyDelete
  8. Many thanks for this nice and useful information. Is there any way to scale-up images ? I mean, if image is larger than screen resolution, lightbox scales down to fit it to the browser. But if image is small, LightBox doesn't scale it up to the maximum size to touch browser window boundaries. How can we do this? (I tried putting width:100%; height:100%; but no luck)

    ReplyDelete
  9. Hi, Portions of my blog that show the time a post was made appear over my images when in Lightbox. Anyone know why and what can be done about it? Visit my sight and view the images within their posts at http://www.melendezphotography.net.

    Thanks for the help!!

    ReplyDelete