I have no idea how to keep the elements in place. When I hover over a floating element, the border is adjusted but this pushes the other elements around (the images are 300x300px). How can I keep them in place? Thanks in advance.
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<h1>These are images</h1>
<div id="container">
<div class="imgDiv">
<img class="img"/>
<h3>Click on image!</h3>
</div>
<div class="imgDiv">
<img class="img"/>
<h3>Click on image!</h3>
</div>
<div class="imgDiv">
<img class="img"/>
<h3>Click on image!</h3>
</div>
<div class="imgDiv">
<img class="img"/>
<h3>Click on image!</h3>
</div>
<div class="imgDiv">
<img class="img"/>
<h3>Click on image!</h3>
</div>
<div class="imgDiv">
<img class="img"/>
<h3>Click on image!</h3>
</div>
</div>
</body>
</html>
The style.css file is:
.imgDiv {
float:left;
border: 1px solid black;
text-align:center;
border-radius:10px;
margin: 0px 10px 10px 0px;
}
.img {
border-radius:10px;
}
.imgDiv:hover {
border: 5px solid black;
}