The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › CSS › Getting an image to fill its container 100%
hi again! trying to get an image to fill its container fully as the browser moves etc… ive tried background-size: 100% auto;
but this doesnt seem to work and the image it tiled? any suggestions?
thanks :)
.heroshot{ float: right; clear: both; width: 75%; height: 60%; margin-top: -35px; margin-right: 40px; border: 6px solid slategrey; background-image: url(lights.jpg); background-size: 100% auto;
}
Hi, Try background-size:cover; If this doesn’t work please try to put together a simple codepen to show the code.
background-size:cover;