Technology Software

How to Create Photo Albums With CSS

    • 1). Open your web page in your favorite text or HTML code editor.

    • 2). Add the following HTML code into your web page where you want your gallery to appear:

      <div>
      <ul>
      <li>
      <a>
      <span></span>
      <img src="thumbs/myimage1.jpg"/></a>
      </li>
      <li>
      <a>
      <span></span>
      <img src="thumbs/myimage2.jpg"/></a>
      </li>
      <li>
      <a>
      <span></span>
      <img src="thumbs/myimage3.jpg"/></a>
      </li>
      </ul>
      </div>

    • 3). Edit the list item codes so the image tags in each list item references your gallery thumbnail image files. If you need additional list items for more images, copy and paste one of the list items, and change the "pic#" class so the "#" continues counting up (giving each link a unique style class).

    • 4). Add the following CSS code to the style section of your web page. This styles the gallery area and will cause the images to align correctly within the gallery area:

      div.gallery {
      position: relative ;
      border: 1px solid silver ;
      height: 350px ;
      width: 750px ;
      }

    • 5). Add the following CSS code to the style section. This styles the thumbnails into a free-flowing grid to the right of the main image area:

      ul.thumbs {
      list-style-type:none;
      width: 250px ;
      float: right ;
      }

      ul.thumbs li {
      float: left ;
      }

    • 6). Add the following CSS code to the style section. This moves and stacks the empty span tags on the left side of the gallery area, and effectively hides them:

      span.fullpic {
      width: 1px ;
      height: 1px ;
      position: absolute ;
      top: 5px ;
      left: 5px ;
      }

    • 7). Add the following CSS code to the style section. This creates the roll-over effect. When the mouse cursor hovers over a thumbnail (identified by the class "pic#" link), the associated span tag is expanded so it is visible. The associated larger sized image is set as the span's background, making it look like the image magically appeared on the left side of the gallery area.

      a.pic1:hover span.fullpic {
      background:url(images/myimage1.jpg);
      background-repeat: no-repeat ;
      height:300px;
      width:300px;
      }

      a.pic2:hover span.fullpic {
      background:url(images/myimage2.jpg);
      background-repeat: no-repeat ;
      height:300px;
      width:300px;
      }

      a.pic3:hover span.fullpic {
      background:url(images/myimage3.jpg);
      background-repeat: no-repeat ;
      height:300px;
      width:300px;
      }

    • 8). Edit the background image references in the CSS code. Note the "pic#" link styles. These styles correspond to the links around the thumbnail images and span tags in the the page's HTML code. Set the background image "URL" to the larger-sized image file corresponding to the thumbnail you associated with each "pic#" link. If you added more thumbnails in the earlier step, add corresponding "a.pic#:hover span" styles.

SHARE
RELATED POSTS on "Technology"
How Do I Print Business Cards With Microsoft Publisher?
How Do I Print Business Cards With Microsoft Publisher?
How to Reduce the Size of Photos Using Adobe Photoshop Elements 3.0
How to Reduce the Size of Photos Using Adobe Photoshop Elements 3.0
Features and Benefits of Project Portfolio Management
Features and Benefits of Project Portfolio Management
Fix Registry - Fix Registry Errors Easily
Fix Registry - Fix Registry Errors Easily
Business Intelligence Solutions and Services
Business Intelligence Solutions and Services
AutoCAD Architecture
AutoCAD Architecture
Best Social Networking Apps
Best Social Networking Apps
IKE
IKE
Help Desk Software by help-desk-software
Help Desk Software by help-desk-software
What's Better - Building a BPM Solution Or Buying One?
What's Better - Building a BPM Solution Or Buying One?
How to Make Music Fade out in Moviemaker
How to Make Music Fade out in Moviemaker
How to Shrink a DVD With Nero Instructions
How to Shrink a DVD With Nero Instructions
Live Chat Software: Four Tips To Help You Get the Most Out of Your Software
Live Chat Software: Four Tips To Help You Get the Most Out of Your Software
How to Stop Rootkits
How to Stop Rootkits
3 First-Rate Foundations for Making Movies
3 First-Rate Foundations for Making Movies
How to Build Game Downloads
How to Build Game Downloads
The Linux Modem How-To
The Linux Modem How-To
Text-Terminals on Linux - 11.6 Terminal Server Connection
Text-Terminals on Linux - 11.6 Terminal Server Connection
The Linux Loadable Kernel Module How-To
The Linux Loadable Kernel Module How-To
How to Create Photo Albums With CSS
How to Create Photo Albums With CSS

Leave Your Reply

*