我无法准确地说出你希望它如何在你的问题中发挥作用。如果您希望font-size根据浏览器的视图大小动态更改,则可以使用vw单位(请参阅下面的jsfiddle预览和代码示例)。
我使用了你在Pastebin上发布的HTML和CSS,但是我在原始帖子中添加了CSS并进行了编辑。
我的更改:
#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;
}
您的HTML可能存在结构性问题,导致以后的样式更改难以实现,但这似乎基于我可以从您的帖子中收集的信息起作用。