2017-04-07 23 views
0

私はfont-sizeを使用しています:vw;親divの幅と高さに応じてフォントサイズを変更する

モバイル作品で
#foti_module_wrapper .tools-nav-option i { 
    color: #666666; 
    font-size: 6.2vw; 
} 
#foti_module_wrapper .tool-nav-label { 
    font-size: 3.2vw; 
    line-height: 4px; 
} 
#foti_module_wrapper .tool-item { 
    -webkit-box-flex: 1; 
    -webkit-flex: 1 0 auto; 
    -ms-flex: 1 0 auto; 
    flex: 1 0 auto; 
    display: flex; 
    text-align: center; 
} 
#foti_module_wrapper .tools-nav-option { 
    -webkit-box-flex: 1; 
    -webkit-flex: 1 0 auto; 
    -ms-flex: 1 0 auto; 
    flex: 1 0 auto; 
    padding: 10px; 
    color: #292929; 
    font-size: 20px; 
    text-align: center; 
    line-height: inherit; 
    cursor: pointer; 
    border: 0; 
    -webkit-appearance: none; 
    -moz-appearance: none; 
    appearance: none; 
    z-index: 2; 
    background: white; 
} 

罰金、しかし、タブレットでのフォントアイコンとテキストのオーバーフローの私のツール項目のパディング...

私はこの

enter image description here enter image description here

を避けたいですこの結果が欲しい: enter image description here

+1

タブレットのコードを書くためにメディアクエリを簡単に使うことができます –

+0

メディアクエリを使用したくありません –

+1

メディアクエリを使用しない唯一の方法はjsです!メディアのクエリを使用しない理由がありますか?それはそのために作られたものです... – MarcelD

答えて

0
#foti_module_wrapper .tool-nav-label { 
    font-size: 3.2vw; 
    line-height: 4px; 
} 

あなたは、フォントサイズを使用することができます:あなたは、それはまた、高さと応答するようにしたい場合は、3.0vhを。 VwおよびVhはそれぞれ幅および高さに対応する。

関連する問題