How to create a thumbnail image CSS?

Following is the code to create a thumbnail image using CSS −


 Live Demo

<!DOCTYPE html>
<meta name="viewport" content="width=device-width, initial-scale=1" />
img {
   border: 3px solid rgb(208, 255, 0);
   border-radius: 4px;
   width: 150px;
   height: 150px;
img:hover {
   box-shadow: 2px 2px 4px 2px rgb(60, 255, 53);
<h1>Thumbnail Image Example</h1>
<a target="_blank" href="">
<img src=""/></a>
<h1>Clicking on the above thumbnail will open image in new tab</h1>


The above code will produce the following output −