Image full screen on mobile

[ad_1]

Hello, based on what I saw in the link, I have the following code which you can use as a starting point …

/* Mobile: below 768px wide screens */
@media (max-width: 767px) {
  .home .page .entry-content .wp-block-image {
    height: calc(90vh - 138px);
  }
  .home .page .entry-content .wp-block-image > img {
    object-fit: cover;
    height: 100%;
  }
}
  • 138px is the header height on mobile
  • 90vh can go up to 100vh, but I used 90vh so the text in the image is not too close to the edge of the screen
  • Please adjust the code to your requirements
  • https://developer.mozilla.org/en-US/docs/Web/CSS
  • Happy WordPressing!

Gerry – this worked perfectly. Thank you for your help on this!

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer