Reduce Image Size (scale) for screens

Homepage Community Forums Ambition Reduce Image Size (scale) for screens

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #20858
    tribalcafe
    Customer

      I want to scale an image in proportion to different screen sizes using media queries. I’ve tried a few different approaches but haven’t got it to work. The main image is on the front 1 section.

      Is there an easy way to accomplish this.

      #20866
      Eric
      Customer

        It’s kind of already set that way, but since some background images are designed differently (different widths, different heights) you would probably have to add in custom modifications depending on the size of those images.

        You can look near the bottom of the css to see the responsive section. Here’s what you could copy and adjust –

        
        @media only screen and (max-width: 760px) {
        
        	.front-page-1,
        	.front-page-4,
        	.front-page-6 {
        		/*background-attachment: scroll;*/
        		-webkit-background-size: cover;
        		-moz-background-size:    cover;
        		background-size:         cover;
        	}
        
        }

        In that example I changed the background size from auto to cover. You can use contain, cover, and auto to have the image adjust on different browser sizes. This is what all other sites use to make background images responsive. The browsers job is to scale the image without distorting it….the best it can. There are still limits though, not every image is going to show 100% width and 100% height from end to end. It really just depends on the type of image.

        You can copy/paste that code and make any more adjustments you need to it, as well as change the browser width 760px to other screen sizes.


        I create awesome sites for awesome people! Contact me if interested – ericsanchez1585@gmail.com

        #22877
        Rob
        Customer

          Excellent. I was just looking for this myself.

        Viewing 3 posts - 1 through 3 (of 3 total)
        • The topic ‘Reduce Image Size (scale) for screens’ is closed to new replies.