在“设置文本大小”选项很大时,禁用Android本机浏览器上的字体提升功能

时间:2015-03-10 07:14:05

标签: android css mobile font-size

我看过很多关于在Android上禁用字体提升的帖子,但我尝试的每个修复都无法正常工作。 条件:HTC Wildfire,Android原生浏览器,选项“设置文字大小”设置为“大”(新模型的默认值)。

我试过了:

  • max-height:100000px;(min-height:1px;)设置为元素及其元素 父母
  • 添加!重要的字体大小规则
  • 始终使用<meta content='width=device-width, initial-scale=1' name='viewport'>

但“设置文字大小”选项会覆盖所有内容。

<h1>Heading</h1>
<div class="apps row">
  <div class="col">
    <article class="app">
      <a class="app_button button-green" href="applink.html" target="_blank">INSTALL</a>
      <img src="img/content/sample-1.jpg" width="64" height="64" class="app_ico">
      <div class="app_desc">
        <h2>Afterlight</h2>
        <p>Protect your device from viruses with 360 Mobile viruses with 360 Mobile viruses with 360 Mobile</p>
        <a class="app_link" href="applink.html" target="_blank">Read more</a>
      </div>
      <a href="applink.html" target="_blank" class="cover-link"></a>
    </article>
  </div>
</div>

h1 {
    font-weight: 300;
    font-size: 18px;
    line-height: 24px;
    color: #555;
    margin: 10px 0 6px;
}
.button-green {
    margin: 0;
    padding: 0;
    text-align: center;
    text-decoration: none;
    border: 1px solid $green;
    display: inline-block;
    vertical-align: middle;
    font-family: 'Open Sans', 'Helvetica', 'Trebuchet MS', 'Droid Sans', Arial, sans-serif;  
    color: $green;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    line-height: 26px;
    border-radius: 5px;
}

// app module
.app {
    position: relative;
    padding: 10px 0;
    border-top: 1px solid $grey_light;
    max-height:100000px;
}
.apps .col:first-child .app:first-child {
  border-top: 0px;
}
.app_ico {
    float: left;
    width: 64px;
    margin-right: 10px;
}
.app_desc {
    height: 64px;
    position: relative;
    overflow: hidden;
    max-height:100000px;
    &:before {
        content:'';
        position: absolute;
        width: 100%;
        height: 30px;
        bottom: 0px;
        left: 0px;
        background: linear-gradient(to bottom, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 40%,rgba(255,255,255,1) 100%);
    }
    h2 {
        font-weight: 600;
        font-size: 12px;
        line-height: 16px;
        color: #000;
        margin: 0px;
    }
    p {
        font-size: 11px;
        line-height: 14px;
        color: $grey;
        margin: 0px;
    }
    a {
        font-size: 11px;
        line-height: 14px;
        text-decoration: none;
        color: $blue;
    }
    .app_link {
        position: absolute;
        left: 0px;
        bottom: 0px;
    }
}
.app_button {
    float: right;
    width: 70px;
    margin: 18px 0 0 10px;
}

0 个答案:

没有答案