我無法確切地告訴您如何從您的問題中解決問題。如果您希望font-size
根據瀏覽器的視圖大小動態更改,則可以使用vw
單位(請參閱下面的jsfiddle預覽和代碼示例)。
試試這個:http://jsfiddle.net/km1hbpzv/1/嘗試調整瀏覽器的大小,看看這是否是你想要的效果。
我使用了在Pastebin上發佈的HTML和CSS,但是我在原始帖子的CSS中添加並編輯了它。
我的變化:使後來的造型變化比較難實現,但是這似乎在基於我從您的文章收集信息的時刻工作與你的HTML
#NewsPosts {
position: relative;
bottom: 0px;
top: -925px;
width: 45%;
//position: center; changed this to text-align: center (below)
text-align: center;
margin: 0 auto;
//font-size: 20px; changed this to 2vw which is percentage of the viewport width
font-size: 2vw;
margin-left: 10;
margin-right: 10;
text-indent: 5;
}
#DateAndBy {
position: relative;
bottom: 0px;
top: -930px;
//font-size: 30px; changed this to 3vw which is a percentage of viewport width
font-size: 3vw;
margin-left: 10;
margin-right: 10;
text-indent: 5;
}
有可能是結構性的問題。
相關vw
單位和其他font-size
實踐的進一步討論可以在這裏找到:Pure CSS to make font-size responsive based on dynamic amount of characters
你能澄清這一點:「文字......將不能正確調整......」 你想要的字體大小減少? – 2014-11-08 05:02:14