Forums

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%

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #271523
    stephie101blue
    Participant

    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;

    }

    #271566
    Pogany
    Participant

    Hi,
    Try background-size:cover;
    If this doesn’t work please try to put together a simple codepen to show the code.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘CSS’ is closed to new topics and replies.