I have a problem with a CSS hover effect I have created.
The hover effect works perfectly, here is the HTML code
<div align="center"><a class="thumbnail" href="http://www.yahoo.com" target="_blank"><img src="images/thumbTest_1.jpg" width="50px" height="68px" border="0" />
<span><img src="images/popoutTest_1.jpg" width="200" height="272" />
<br />Image Description</span></a>
</div>
And here's the CSS...
/*Credits: Dynamic Drive CSS Library */
/*URL: http://www.dynamicdrive.com/style/ */
.thumbnail
{
position: relative;
z-index: 0;
padding-left:40;
padding-right:40;
}
.thumbnail:hover
{
background-color: transparent;
z-index: 50;
text-decoration: none;
}
.thumbnail span /*CSS for enlarged image*/
{
position: absolute;
background-color: lightyellow;
padding: 5px;
left: -1000px;
border: 1px dashed gray;
visibility: hidden;
color: black;
text-decoration: none;
}
.thumbnail span img /*CSS for enlarged image*/
{
border-width: 0;
padding: 2px;
}
.thumbnail:hover span /*CSS for enlarged image on hover*/
{
visibility: visible;
left: 60px; /*position where enlarged image should offset horizontally */
top: 10px;
}
As I said, this is all working perfectly. However I want to make it where the hover image will sense the border of the browser and self adjust so that the hover image will always be visible and not pop off the side or bottom or the page.
Can this be done with CSS? if not, how can it be done? Thanks for your help and suggestions.