html - How can I make a border wrap around a group of pictures? -


i'm trying figure out how make border fit around group of images. can see in jsfiddle posted, border fits around top , left corner, doesn't fit around bottom , right corners. here html:

<!doctype html>     <html>         <head>             <title>gallery test</title>             <link type="text/css" rel="stylesheet" href="css.css"/>         </head>         <div class="album">                 <span><img class="img1" id="imgalbum" src="http://images.nationalgeographic.com/wpf/media-live/photos/000/006/cache/red-                                      fox_679_600x450.jpg">                 </span>                 <span><img class="img2" id="imgalbum" src="http://images.nationalgeographic.com/wpf/media-live/photos/000/006/cache/red-                                      fox_679_600x450.jpg">                 </span>                 <span><img class="img3" id="imgalbum" src="http://images.nationalgeographic.com/wpf/media-live/photos/000/006/cache/red-                                      fox_679_600x450.jpg">                 </span>                       </div>   </html> 

and here css:

.img1{     border-width:4px;     border-style:solid; } .img2 {     position:relative;     right: 90px;     top:5px;     z-index:-1;      border-width:4px;     border-style:solid; } .img3{     position:relative;     right:180px;     top:10px;     z-index:-2;      border-width:4px;     border-style:solid; } .album {     border-width:2px;     border-style:solid;     border-color:#78c9a9;     display:inline-block; }  #imgalbum {     height:150px;     width:100px; } p {     color:red; } 

thanks in advance!

there errors in css/html. corrected them , floated images border raps them exactly. removed <span> tag not used.

demo

html :

    <div id="album">         <img id="img1" class="imgalbum" src="http://images.nationalgeographic.com/wpf/media-live/photos/000/006/cache/red-                                       fox_679_600x450.jpg" />         <img id="img2" class="imgalbum" src="http://images.nationalgeographic.com/wpf/media-live/photos/000/006/cache/red-                                      fox_679_600x450.jpg" />         <img id="img3" class="imgalbum" src="http://images.nationalgeographic.com/wpf/media-live/photos/000/006/cache/red-                                      fox_679_600x450.jpg" />                        </div> 

css :

#img2 {     z-index:-1;     margin: 5px 0 0 -90px; } #img3{     z-index:-2;     margin: 10px 0 0 -80px;  } #album {     border-width:2px;     border-style:solid;     border-color:#78c9a9;     display:inline-block; }  .imgalbum {     position:relative;     height:150px;     width:100px;     border:4px solid #000;     display:block;     float:left; } p {     color:red; } 

Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -