2014-09-10 31 views
1

我在html頁面中有一個有背景圖像,左側標題文本和右側註冊表單的部分。在不使用其他媒體查詢的情況下響應頁面的響應div寬度

我正在使用媒體查詢使其響應。即使在媒體查詢被觸發之前,我仍面臨着這個問題。

當屏幕尺寸爲768 + px(如在我的小提琴中,在表單滑入下一行之前),標題的寬度爲15%(因爲它避免了與圖像中的女性臉部重疊,形成)。但是隨着屏幕尺寸的增大,看起來太少了,線條可能在同一條線上。

當506像素和768像素之間的屏幕尺寸存在媒體查詢時,也會發生這種情況。

有沒有一種方法可以解決這個問題,而不必使用anotehr媒體查詢?

任何幫助,非常感謝。

感謝,

<section class="imageform"> 

<div class="container"> 
<div class="title"> 
<h1> Title Title Title Title </h1> 
<h3> Title Title Title, Title Title </h3> 
</div> 

<form class="signup_form"> 

<label for="Name"><strong> Your Name:</strong></label> 
<input type="text" id="Name_First" name="Name_First" required> 
<input type="text" id="Name_Last" name="Name_Last" required> 

<label for="Email">Email Address:</label> 
<input type="email" id="Email" name="Email" vrequired> 

<label for="RegPassword">Password:</label><input type="password" id="RegPassword" name="RegPassword" required> 
</form> 

</section> <!--End of imageform section --> 

JS提琴:http://jsfiddle.net/fwkqos0c/6/

+0

那麼有沒有_any_媒體查詢在你的例子所以我們怎麼可能告訴? – Turnip 2014-09-10 18:25:27

回答

1

這裏一個簡單的解決辦法是發送對您title類相對字體大小。相對而言,我的意思是em's。這意味着您的標題字體大小會自動調整爲父對象的大小。

更多的幫助:

http://css-tricks.com/why-ems/

(如果我的回答幫助我成爲一個批准感激)