Home | Logo Design | Examples | Networking | Articles | Contact Us
Lightbox effect is very useful because it pulls the attention of the reader towards the image. It does this by bringing the image to the center of the screen and darkening around it. This is great for pages that have a lot of pictures, because it allows the visitor to view each image separately. But this technique applies to more than just images. This effect will also work with text and logins as well. There is some Java involved but the effect itself it caused by CSS. To see this is action click here.First you are going to have to add some code to your CSS file. Copy and paste the code from below.
The black_overlay is the class that will create the fade effect. It will not display normally because the display is set to none. One of the other uses is to load on startup for a login page. The white_content class is actual box the image or whatever you use will sit in. This layer is set to overflow auto meaning that if your image/text is larger than the box than it will become scrollable. The border in this section is the border around the lightbox, I chose blue because it goes with my colors. Now we have to add in the HTML to make this work. Copy the snippet below into your HTML file, in the BODY element.
The code above is what is used in the example. Here is a quick breakdown of the code :
You can get the CSS, HTML and images here to experiment with. Feel free to use this code to enhance your site. In the next part of the series we are going to discuss ways to alter your visited links with CSS.