Results 1 to 3 of 3

Thread: CSS Image Gallery Problem

  1. #1
    Join Date
    Sep 2008
    Location
    Bristol - UK
    Posts
    842
    Thanks
    32
    Thanked 132 Times in 131 Posts

    Default CSS Image Gallery Problem

    Hi there, I recently started work on my dad's website and after doing most of it I decided to use the image gallery from the website http://www.dynamicdrive.com/style/cs...image-gallery/
    I managed to sort it all out in firefox, but as per usual, internet explorer didn't want to know . Here is the source code for it (including CSS):

    <head>
    <style type="text/css">

    .gallerycontainer{
    position: relative;
    top:380px;
    left:230px;
    /*Add a height attribute and set to largest image's height to prevent overlaying*/
    }

    .thumbnail img{
    border: 1px solid white;
    margin: 0 5px 5px 0;
    }

    .thumbnail span{ /*CSS for enlarged image*/
    position: absolute;
    padding: 0px;
    left: -1000px;
    visibility: hidden;
    color:#0066cc;
    text-decoration: none;
    text-align:center;
    font-size:12pt;
    white-space:nowrap;
    }

    .thumbnail span img{ /*CSS for enlarged image*/
    border-width: 0;
    padding: 2px;
    }

    .thumbnail:hover span{ /*CSS for enlarged image*/
    visibility: visible;
    top: 0px;
    left:280px; /*position where enlarged image should offset horizontally */
    z-index: 50;
    }

    </style>
    </head>

    Here is the html body code:

    <div class="gallerycontainer">

    <a class="thumbnail" href="#thumb"><img src="tabs/narrowboatboxes/test1.jpg" width="100px" height="66px" border="0" style="opacity:0.4; filter:alpha(opacity=40)"
    onmouseOver="this.style.opacity=1; this.filters.alpha.opacity=100"
    onmouseOut="this.style.opacity=0.4; this.filters.alpha.opacity=40"/>
    <span><img src="tabs/narrowboatboxes/test1.jpg"</span></a>

    <a class="thumbnail" href="#thumb"><img src="tabs/narrowboatboxes/test2.jpg" width="100px" height="66px" border="0" style="opacity:0.4; filter:alpha(opacity=40)"
    onmouseOver="this.style.opacity=1; this.filters.alpha.opacity=100"
    onmouseOut="this.style.opacity=0.4; this.filters.alpha.opacity=40"/>
    <span><img src="tabs/narrowboatboxes/test2.jpg"</span></a>

    <br/>

    <a class="thumbnail" href="#thumb"><img src="tabs/narrowboatboxes/test3.jpg" width="100px" height="66px" border="0" style="opacity:0.4; filter:alpha(opacity=40)"
    onmouseOver="this.style.opacity=1; this.filters.alpha.opacity=100"
    onmouseOut="this.style.opacity=0.4; this.filters.alpha.opacity=40"/>
    <span><img src="tabs/narrowboatboxes/test3.jpg"</span></a>

    <a class="thumbnail" href="#thumb"><img src="tabs/narrowboatboxes/test4.jpg" width="100px" height="66px" border="0" style="opacity:0.4; filter:alpha(opacity=40)"
    onmouseOver="this.style.opacity=1; this.filters.alpha.opacity=100"
    onmouseOut="this.style.opacity=0.4; this.filters.alpha.opacity=40"/>
    <span><img src="tabs/narrowboatboxes/test4.jpg"</span></a>

    </div>

    <div style="position:absolute; top:550px; left:230px; width:200px; font-size:14pt; color:#0066cc">
    Roll over the images to view them.
    </div>

    Hope you can sort out my problem - in internet explorer only the first "test1.jpg" image shows up and the rest aren't there, also the "Roll over the images to view them" text does not show up either =/.

    Thanks in advance,

    Jack

  2. #2
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    You missed to close your img tag:
    Code:
    <a class="thumbnail" href="#thumb"><img src="tabs/narrowboatboxes/test1.jpg" width="100px" height="66px" border="0" style="opacity:0.4; filter:alpha(opacity=40)" 
    onmouseOver="this.style.opacity=1; this.filters.alpha.opacity=100" 
    onmouseOut="this.style.opacity=0.4; this.filters.alpha.opacity=40"/>
    <span><img src="tabs/narrowboatboxes/test1.jpg"></span></a>
    
    <a class="thumbnail" href="#thumb"><img src="tabs/narrowboatboxes/test2.jpg" width="100px" height="66px" border="0" style="opacity:0.4; filter:alpha(opacity=40)" 
    onmouseOver="this.style.opacity=1; this.filters.alpha.opacity=100" 
    onmouseOut="this.style.opacity=0.4; this.filters.alpha.opacity=40"/>
    <span><img src="tabs/narrowboatboxes/test2.jpg"></span></a>
    
    <br/>
    
    <a class="thumbnail" href="#thumb"><img src="tabs/narrowboatboxes/test3.jpg" width="100px" height="66px" border="0" style="opacity:0.4; filter:alpha(opacity=40)" 
    onmouseOver="this.style.opacity=1; this.filters.alpha.opacity=100" 
    onmouseOut="this.style.opacity=0.4; this.filters.alpha.opacity=40"/>
    <span><img src="tabs/narrowboatboxes/test3.jpg"></span></a>
    
    <a class="thumbnail" href="#thumb"><img src="tabs/narrowboatboxes/test4.jpg" width="100px" height="66px" border="0" style="opacity:0.4; filter:alpha(opacity=40)" 
    onmouseOver="this.style.opacity=1; this.filters.alpha.opacity=100" 
    onmouseOut="this.style.opacity=0.4; this.filters.alpha.opacity=40"/>
    <span><img src="tabs/narrowboatboxes/test4.jpg"></span></a>
    See if adding highlighted helps.
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  3. #3
    Join Date
    Sep 2008
    Location
    Bristol - UK
    Posts
    842
    Thanks
    32
    Thanked 132 Times in 131 Posts

    Default

    Ohh! Thanks man, sorted now, great code ^^

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •