html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -


first of all, thank being patient know simple question more couple of weeks' experience figure out. i've seen folks persevere , helpful on here , hope you're willing me.

here fiddle: http://jsfiddle.net/65uzf/

here 1 of places searched answers on here: (vertically center image thumbnails fix-sized div) tried solutions on there , didn't work out me. i've searched ~4 or 5 others, , been unsuccessful those, too.

what want take large image (what linked background-image #ysypic , #tabpic divs) , display thumbnail version of image in confines of divs have set it. is, using background properties have laid out in css, portion of image displays inside of circular divs. without these properties, display defaults smaller section of image [presumably pi*(50^2) area in top left] terrible resolution.

i not care if entire image doesn't display inside of circles (it won't, given difference in shape), , overflow not being displayed fine. want able see figures in center of each image, , not little portion of heads.

please inform me if method of using background-image not best approach, too. want able elsewhere, i.e. taking large versions of images , displaying them small inside of smaller normal resolution.

html:

<!doctype html> <html> <head> <link rel='stylesheet' href='style.css'/> <script src='script.js'></script> </head> <body>     <div class="container">         <div class="piccontain">             <div id="ysypic">                 <a href="www.thejourneytothebest.com/ysyprofile" class="guanyin" style="background-image:url('http://i.imgur.com/lbarywr.jpg')"></a>             </div>         </div>         <div class="piccontain">             <div id="tabpic">             </div>         </div>     </div> </body> </html> 

css:

body {     background-image:url('http://i.imgur.com/klzakvc.jpg');     background-attachment:fixed;     background-position:center;     background-size:100% 100%;  } .container {     text-align:center; } .piccontain {     width:150px;     height:200px;     background-color:white;     border-radius:10%;     display:inline-block; } #ysypic {     width:100px;     height:100px;     border-radius:100%;     margin-left:25px;     background-image:url('http://i.imgur.com/lbarywr.jpg');     background-attachment:fixed;     background-position:center;     background-size:cover;     background-repeat:no-repeat; } #tabpic{     width:100px;     height:100px;     border-radius:100%;     margin-left:25px;     background-image:url('http://i.imgur.com/yj4ronn.jpg');     background-attachment:fixed;     background-position:center;     background-size:cover;     background-repeat:no-repeat; } 

i tried image tag , overflow property :

.test{     width:100px;     height:100px;     border-radius:100%;     margin-left:25px;     overflow:hidden; } .test img{      width:150px;     height:200px;     margin-top:-50px;     margin-left:-30px; }  

http://jsfiddle.net/t5fkl/

is looking for?


Comments

Popular posts from this blog

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -