css - Why does iOs Safari show full size of background-image? -
i'm working on site have boxes background-images thumbnails. have use background-image because cms working on pretty old-dated , client won't change (mon€y main-problem).
i figured out strange behavior in ios safari on ipad2 & iphone5 (latest ios) , don't know why.
here's code:
a img, .thumb, figcaption, a:hover .thumb { -webkit-transition: .3s; -moz-transition: .3s; -ms-transition: .3s; -o-transition: .3s; transition: .3s; } .thumb { height: 250px; margin-bottom: 28px; overflow: hidden; background-size: 100% 100%; background-position: center; background-repeat: no-repeat; } figcaption { background-color: #b61910; background-color: rgba(182, 25, 16, .85); position: absolute; height: 39px; bottom: 35px; color: white; width: calc(100% - 30px); } figcaption h3 { font-style: normal; position: absolute; bottom: 5px; margin-top: 0; margin-bottom: 0; padding: 10px 0 0 5px; transition: transform 0.3s; transform: translate3d(0, 0%, 0); } a:hover h3 { transform: translate3d(0, -20%, 0); text-shadow: 1px 1px 1px #000; } a:hover figcaption { height: 5px; } a:hover .thumb { background-size: 120% 120%; opacity: .8 }
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet" /> <div class="container"> <div class="row"> <a href=""> <div class="col-sm-12"> <figure class="thumb" style="background-image:url(http://lorempixel.com/output/food-h-c-850-890-7.jpg)"> <figcaption> <h3>product-title</h3> </figcaption> </figure> </div> </a> </div> </div>
on desktop shows whole image on ios looks shows original size inside thumbnail-box. how can solve problem?
any great :) thanks
moesphemie
maybe? https://css-tricks.com/forums/topic/full-page-backgrounds-on-ios-background-size-cover/
code:
background: url(images/bg.jpg) no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover;
Comments
Post a Comment