div.img
{
margin:7px;
border:3px solid gray;
height:110px;
width:110px;
float:left;
text-align:center;
}
div.img img
{
display:inline;
margin:3px;
border:1px solid white;
}
div.img a:hover img
{
border:3px solid yellow;
}
function handleMouseClick(imageName)
{
document.getElementById(imageName).style.borderWidth = '3';
document.getElementById(imageName).style.borderStyle = 'solid';
document.getElementById(imageName).style.borderColor = 'yellow';
}
I have some JS and CSS code pasted above which renders borders images with borders and changes the image border on mouseclick to '3px solid yellow'. This code works as expected but I would like to know if there is a better way to do this through CSS instead of the JS code I have in handleMouseClick(...).
Secondly, when I select my image, the image border changes as expected to '3px solid yellow' but since the img element is a child of "<a href...> </a>
", I also see a dotted blue border around the image. How do I get rid of the blue border?