I want to add image gallery to my blog. I want the background color of images to be #dcdcdc. when i change the background color, all the images appear to be in a single image like this(in the picture attached below)
i want to add space between two images.
how can i give space between two images in CSS image gallery.
please provide me the code.
Any help would be appreciated.
<!DOCTYPE html><html><head><style>
div.gallery {margin:5px;border:1px solid #ccc;float: left;width:180px;}
div.gallery:hover {border:1px solid #777;}
div.gallery img {width:100%;height: auto;}
div.desc {padding:15px;text-align: center;}</style></head><body><divclass="gallery"><atarget="_blank"href="img_5terre.jpg"><imgsrc="img_5terre.jpg"alt="Cinque Terre"width="600"height="400"></a><divclass="desc">Add a description of the image here</div></div><divclass="gallery"><atarget="_blank"href="img_forest.jpg"><imgsrc="img_forest.jpg"alt="Forest"width="600"height="400"></a><divclass="desc">Add a description of the image here</div></div><divclass="gallery"><atarget="_blank"href="img_lights.jpg"><imgsrc="img_lights.jpg"alt="Northern Lights"width="600"height="400"></a><divclass="desc">Add a description of the image here</div></div><divclass="gallery"><atarget="_blank"href="img_mountains.jpg"><imgsrc="img_mountains.jpg"alt="Mountains"width="600"height="400"></a><divclass="desc">Add a description of the image here</div></div></body></html>
CSS image gallery
in CSS
Posted
I want to add image gallery to my blog. I want the background color of images to be #dcdcdc. when i change the background color, all the images appear to be in a single image like this(in the picture attached below)
i want to add space between two images.
how can i give space between two images in CSS image gallery.
please provide me the code.
Any help would be appreciated.