Max-height ignored in Firefox, works in Chrome and Safari

后端 未结 5 1115
耶瑟儿~
耶瑟儿~ 2020-12-03 17:13

I\'m making a slideshow of images with the class display. I want to limit the height and width of the image to a maximum of 80% of the window\'s, so that there

5条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-03 18:12

    I agree with @Uds, you will need to specify the height and width of the body and html element

    Other thing to keep in mind:

    Moreover you will also need to define the browser in CSS code, you can define it by follow:

    .display{
      /* For general browser */
      max-width: 80%;
      max-height: 80%;
    
      /* For Firefox browser */
      -moz-width: 80%;
      -moz-height:80%;
    
      /* For Chrome and Safari browser */
      -webkit-width: 80%;
      -webkit-height:80%;
    
      /* For Opera browser */
      -o-width: 80%;
      -o-height:80%;
    }
    

    This will specify that which browser should have what kind of height or width.

提交回复
热议问题