jenjen
10-19-2010, 05:49 PM
I've seen a lot of posts about how CSS doesn't work quite right in IE 6 or 7 when it comes to Hover boxes - or in my instance, a photo hover.
I'm here to post my code because I simply cannot figure out why it won't work, please help! I appreciate it.
CSS CODE:
*
{
border: 0;
margin: 0;
padding: 0;
}
/* =Basic HTML, Non-essential
----------------------------------------------------------------------*/
a
{
text-decoration: none;
}
body
{
background: #fff;
color: #777;
margin: 0 auto;
padding: 50px;
position: relative;
width: 620px;
}
h1
{
background: inherit;
border-bottom: 1px dashed #ccc;
color: #933;
font: 17px Georgia, serif;
margin: 0 0 10px;
padding: 0 0 5px;
text-align: center;
}
p
{
clear: both;
font: 10px Verdana, sans-serif;
padding: 10px 0;
text-align: center;
}
p a
{
background: inherit;
color: #777;
}
p a:hover
{
background: inherit;
color: #000;
}
/* =Hoverbox Code
----------------------------------------------------------------------*/
.hoverbox
{
cursor: default;
list-style: none;
}
.hoverbox a
{
cursor: default;
}
.hoverbox a .preview
{
display: none;
}
.hoverbox a:hover .preview
{
display: inline;
position: relative;
top: -33px;
left: -45px;
z-index: 1;
}
.hoverbox img
{
background: #fff;
border-color: #aaa #ccc #ddd #bbb;
border-style: solid;
border-width: 1px;
color: inherit;
padding: 2px;
vertical-align: top;
width: 100px;
height: 75px;
}
.hoverbox li
{
background: #eee;
border-color: #ddd #bbb #aaa #ccc;
border-style: solid;
border-width: 1px;
color: inherit;
display: inline;
float: left;
margin: 3px;
padding: 5px;
position: relative;
}
.hoverbox .preview
{
border-color: #000;
width: 200px;
height: 150px;
}
HTML - it's a huge page of photos, here is a bit of the html:
<h2>NWIBRT 2010 Golf Outing</h2>
<ul class="hoverbox">
<li><a href="#"><img src="/data/dmsnwibrt/image/Untitled-1.jpg" alt="" width="327" height="245" /><img class="preview" src="/data/dmsnwibrt/image/Untitled-1.jpg" alt="" width="327" height="246" /></a> </li>
<li><a href="#"><img src="/data/dmsnwibrt/image/Untitled-3.jpg" alt="" width="327" height="245" /><img class="preview" src="/data/dmsnwibrt/image/Untitled-3.jpg" alt="" width="327" height="245" /></a></li>
<li><a href="#"><img src="/data/dmsnwibrt/image/Untitled-4.jpg" alt="" width="327" height="245" /><img class="preview" src="/data/dmsnwibrt/image/Untitled-4.jpg" alt="" width="327" height="245" /></a></li>
<li><a href="#"><img src="/data/dmsnwibrt/image/Untitled-5.jpg" alt="" width="327" height="245" /><img class="preview" src="/data/dmsnwibrt/image/Untitled-5.jpg" alt="" width="327" height="245" /></a></li>
<li><a href="#"><img src="/data/dmsnwibrt/image/Untitled-8.jpg" alt="" width="327" height="245" /><img class="preview" src="/data/dmsnwibrt/image/Untitled-8.jpg" alt="" width="327" height="245" /></a></li>
<li><a href="#"><img src="/data/dmsnwibrt/image/Untitled-9.jpg" alt="" width="327" height="245" /><img class="preview" src="/data/dmsnwibrt/image/Untitled-9.jpg" alt="" width="327" height="245" /></a></li>
</ul>
<p style="clear: both; text-align: center;"><a href="/index.cfm/fuseaction~home.home/pid~43/page~NWIBRT_Safety_Seminar_2010_Photos">View Full Gallery</a></p>
<p> </p>
I'm here to post my code because I simply cannot figure out why it won't work, please help! I appreciate it.
CSS CODE:
*
{
border: 0;
margin: 0;
padding: 0;
}
/* =Basic HTML, Non-essential
----------------------------------------------------------------------*/
a
{
text-decoration: none;
}
body
{
background: #fff;
color: #777;
margin: 0 auto;
padding: 50px;
position: relative;
width: 620px;
}
h1
{
background: inherit;
border-bottom: 1px dashed #ccc;
color: #933;
font: 17px Georgia, serif;
margin: 0 0 10px;
padding: 0 0 5px;
text-align: center;
}
p
{
clear: both;
font: 10px Verdana, sans-serif;
padding: 10px 0;
text-align: center;
}
p a
{
background: inherit;
color: #777;
}
p a:hover
{
background: inherit;
color: #000;
}
/* =Hoverbox Code
----------------------------------------------------------------------*/
.hoverbox
{
cursor: default;
list-style: none;
}
.hoverbox a
{
cursor: default;
}
.hoverbox a .preview
{
display: none;
}
.hoverbox a:hover .preview
{
display: inline;
position: relative;
top: -33px;
left: -45px;
z-index: 1;
}
.hoverbox img
{
background: #fff;
border-color: #aaa #ccc #ddd #bbb;
border-style: solid;
border-width: 1px;
color: inherit;
padding: 2px;
vertical-align: top;
width: 100px;
height: 75px;
}
.hoverbox li
{
background: #eee;
border-color: #ddd #bbb #aaa #ccc;
border-style: solid;
border-width: 1px;
color: inherit;
display: inline;
float: left;
margin: 3px;
padding: 5px;
position: relative;
}
.hoverbox .preview
{
border-color: #000;
width: 200px;
height: 150px;
}
HTML - it's a huge page of photos, here is a bit of the html:
<h2>NWIBRT 2010 Golf Outing</h2>
<ul class="hoverbox">
<li><a href="#"><img src="/data/dmsnwibrt/image/Untitled-1.jpg" alt="" width="327" height="245" /><img class="preview" src="/data/dmsnwibrt/image/Untitled-1.jpg" alt="" width="327" height="246" /></a> </li>
<li><a href="#"><img src="/data/dmsnwibrt/image/Untitled-3.jpg" alt="" width="327" height="245" /><img class="preview" src="/data/dmsnwibrt/image/Untitled-3.jpg" alt="" width="327" height="245" /></a></li>
<li><a href="#"><img src="/data/dmsnwibrt/image/Untitled-4.jpg" alt="" width="327" height="245" /><img class="preview" src="/data/dmsnwibrt/image/Untitled-4.jpg" alt="" width="327" height="245" /></a></li>
<li><a href="#"><img src="/data/dmsnwibrt/image/Untitled-5.jpg" alt="" width="327" height="245" /><img class="preview" src="/data/dmsnwibrt/image/Untitled-5.jpg" alt="" width="327" height="245" /></a></li>
<li><a href="#"><img src="/data/dmsnwibrt/image/Untitled-8.jpg" alt="" width="327" height="245" /><img class="preview" src="/data/dmsnwibrt/image/Untitled-8.jpg" alt="" width="327" height="245" /></a></li>
<li><a href="#"><img src="/data/dmsnwibrt/image/Untitled-9.jpg" alt="" width="327" height="245" /><img class="preview" src="/data/dmsnwibrt/image/Untitled-9.jpg" alt="" width="327" height="245" /></a></li>
</ul>
<p style="clear: both; text-align: center;"><a href="/index.cfm/fuseaction~home.home/pid~43/page~NWIBRT_Safety_Seminar_2010_Photos">View Full Gallery</a></p>
<p> </p>