Home  >  Q&A  >  body text

html - Elements display differently in Google and Firefox browsers. Want to use a css hack to solve it?

The height of the p element is displayed differently in Google and Firefox browsers. I want to use css hack to solve it.

But these two pieces of code don't work. Can someone explain it to me? . .

淡淡烟草味淡淡烟草味2586 days ago824

reply all(2)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-06-17 09:18:40

    //google
    

    @media screen and (-webkit-min-device-pixel-ratio:0}{

                tr { 
                height: 30px;
                 }
            }
    

    //firefox

    @-moz-document url-prefix() {
              tr {
                 height: 40px;
              }
            }

    Isn’t this compatible way of writing height?

    reply
    0
  • 阿神

    阿神2017-06-17 09:18:40

    Height does not have prefixes like -webkit or -moz, so there should be no compatibility issues with height.
    What you are asking about is that the p screenshot is tr. I don’t know if there are other elements in your p, and you are sure it is not due to internal elements.

    reply
    0
  • Cancelreply