2016-05-04 15 views
1

例:enter image description herehttp://www.jpeg.cz/images/2016/05/04/uEf8S.jpgフォントサイズの素子幅と同じ

こんにちは、それは要素としてfont-size同じwidthを作り、それが反応するか、それがすべての解像度に固定しなければならないとすることができますか?

HTML:

<h1>Lorem ipsum dolor!</h1> 
<div id="form-wrapper"> 
    <form action="#" method="post"> 
     <input type="text" name="fullname" placeholder="Jméno a příjmení" /> 
     <input type="email" name="email" placeholder="E-mail" /> 
     <input type="tel" name="tel" placeholder="Telefon" /> 
     <input type="submit" value="ODESLAT" /> 
    </form> 
</div> 

CSS:

@media only screen and (max-width: 767px) { 
    section h1 { 
     font-size: xx; 
    } 
    #form-wrapper { 
     width: 320px; 
    } 
} 

@media (min-width: 768px) { 
    section h1 { 
     font-size: xx; 
    } 
    #form-wrapper { 
     max-width: 425px; 
    } 
} 

@media (min-width: 1200px) { 
    section h1 { 
     font-size: 50px; 
     font-size: 3.125rem; 
    } 

    /* form */ 
    #form-wrapper { 
     max-width: 590px; 
    } 
} 
+0

P ossible [コンテナの幅に基づくフォントのスケーリング]の複製(http://stackoverflow.com/questions/16056591/font-scaling-based-on-width-of-container) –

答えて

0

フィドルDemo

h1{ 
    text-transform:uppercase; 
    margin: 0px 0px; 
    font-size: 18px; 
    text-align:center; 
    letter-spacing:.8px; 
     font-size:6.4vw; } 

ドクソースHere

関連する問題