Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Min height without stretching the image, CSS-Mediaqueries

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #205397
    Kevin Mamaqi
    Participant

    Hello,

    I’m trying to solve a problem I got when an user views my website from mobile devices: http://wildlion.kevinmamaqi.com/artista/the-faith-keepers/. The problem is that the picture is wider and for large screens (desktop) the code works well, it resizes and got a max-height property which limits it, but, for smaller devices is not good enough, the image is to small and is impossible to visualize the picture.

    I can’t find a solution without having a large horizontal scrollbar, which is not very convenient.

    #205398
    cRckls
    Participant

    You could set the image as a background image on the div.artistas-bg, then set:

    background-size: cover;
    background-repeat: no-repeat;
    background-position: center 30px;

    This should scale the image to look quite nice on mobile.

    #205399
    Kevin Mamaqi
    Participant

    I can’t set it as a background image (or I don’t know how), it is the featured image of a WordPress article.

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