• Resolved dfart

    (@dfart)


    Hi.

    In my web I have pages with images that, from the computer look good but if I enter from a phone, they are cut by not fitting on the screen.

    Would there be any way to make them adapt automatically ?.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hey @dfart,

    There are methods of resizing the images using CSS. A common way to do it is using some CSS like so:

    @media only screen and (max-width: 720px)  {
        .your-image-classname {
            max-width:100%;
            height: auto;
        }
    }
    

    This code says that if the browser size is under 720px wide then to set the maximum width of images to be 100% of their container and let the height float to the correct size. You would need to change .your-image-classname to match the classname or targeting of the images on your site.

    That might be enough to make things work for you however usually some specific tailoring needs to happen for the images in different places so they look right how you want them on various different sizes.

    • This reply was modified 6 years, 11 months ago by williampatton.
    Thread Starter dfart

    (@dfart)

    Thanks for your answer.

    I’m a little lost, I’m learning to do these things and I still do not control very well.

    Where do I have to paste that line of code? In the style.css or in each image?

    Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Images on mobile’ is closed to new replies.