我發現了一個關於在特定的div專門修改文本大小的移動,這樣的修改後的文本字體大小:無法在移動
@media only screen and (max-width: 480px) {
.news {
font-size: 5px;
}
}
我不能得到那個不過,對於現場工作我在搞亂。我希望在移動設備上打開時字體大小更小。雖然我不知道是否必須在html中設置視口meta,但每次我這樣做時,它都不能修復它,B,它完全破壞了我網站的平衡,剪下了大量的信息,喜歡。所以,我現在唯一能夠使用視口的方法是,如果它根本不混亂縮放因子。不知道這是否是問題。 真的很感謝這方面的幫助。全碼:
CSS:
*{
margin:0;
padding:0;
}
body{
text-align:center; /*For IE6 Shenanigans*/
font-size: 100%;
font-weight: 1;
font-family: 'rationale';
background:black;
}
#newsusa {
position: absolute; /*makes it relative to the html element, (the first
positioned element).*/
width: 100%; /*makes the element 100%, to center it. */
left: 0px;
top: 200px;
}
.news {
color: white;
font-size: 18px;
}
li {
list-style-type: none;
}
@media only screen and (max-width: 480px) {
.news {
font-size: 0.8em;!important;
}
}
@media only screen and (max-width: 280px) {
.news {
font-size: 0.8em;!important;
}
}
XHTML:
<?php include 'global.php';?>
<html xmlns="http://www.w3.org/1999/xhtml">
<html lang="en">
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="mobiletest.css">
<link href='//fonts.googleapis.com
/css?family=Iceland|Rationale|Quantico|VT323|Dorsa' rel='stylesheet'
type='text/css'>
<script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3
/jquery.min.js'></script>
<div id="newsusa">
<h1 class="appear-later">News</h1>
<div class="spacer1">
</div>
<div class="news">
<ul><?php outputValueFromCache('usnews', 'ignore'); ?></ul>
</div>
<div class="spacer2">
</div>
<h1 class="appear-later">Tech</h1>
<div class="spacer1">
</div>
<div class="news">
<ul><?php outputValueFromCache('usatechnews', 'ignore'); ?></ul>
</div>
<div class="spacer2">
</div>
<h1>Business</h1>
<div class="spacer1">
</div>
<div class="news">
<ul><?php outputValueFromCache('usamoneynews', 'ignore'); ?></ul>
</div>
</div>
</html>
嘗試使用'font-size:5px;!important'並使用'em'來處理,如'font-size:0.8em;!important' – hansTheFranz