我发现了一个关于在特定的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