Problem description

  • Mobile Baidu APP, H5 web pageposition:fixedAttribute invalid.
  • The H5 has a suction on the bottomdiv(similar to download app at the bottom), there arebackground-img. The Baidu app was shut down as soon as it entered the page. The reason is, Baidu thought we were pushing ads, and they detected it.

The solution

  • In the afternoon, my colleague gave me feedback that there was something wrong with the H5 publicity page made by the publicity department. Kuangkuang threw me a zip package. Open it up. Index.html, js, images. Quickly put in nginx with mobile phone access to try, look at someone else’s code. Will it need to be triggered actively, will it need to be based on top positioning, etc., random try for a long time, but it did not work.

  • As a result, when the bottom div height is less than 150px, Baidu will consider it a pop-up AD and close it.

  • Fixed div height greater than 150px is ok, change someone else’s code, tell him why, let her do it herself.

.footer {
    display: none;
    position: fixed;
    bottom: -8px;
    left: 0px;
    right: 0px;
    width: 375px;
    height: 150px;
    background: url("./images/xd-img.png") no-repeat;
    background-size: 375px 136px;
    background-position: bottom;
}
Copy the code

Yes, more than or equal to 150px !!!!

In the end, they found that their mobile terminal is based on PX, not compatible models