【发布时间】:2016-09-28 22:13:07
【问题描述】:
我已经尝试了所有我能想到的让这种布局适合移动设备的方法,但它似乎并不想工作。我已经放了视口,元标记。我已经放了@media css标签,还是没有区别。
这完全让我感到困惑,为什么这不起作用。
这里是 HTML/CSS:
</title>
<style>
@font-face {
font-family: 'trench';
src: url('fonts/trench100free.ttf');
}
.content {
width: 480px;
overflow: hidden;
}
.trench-bold {
text-align: left;
font-family: trench;
font-size: 55px;
font-weight: bold;
color: white;
}
.pull {
margin-bottom: 2px;
font-size: 150%;
font-family: trench;
font-weight: bold;
-webkit-transition: .5s ease;
transition: .5s ease;
width: 180px;
padding: 5px;
color: black;
background-color: white;
text-align: right;
}
.pull:hover{
-webkit-transition: .5s ease;
width: 80%;
background-color: red;
text-size: 175%;
transition: .5s ease;
}
body {
margin: 0px;
}
a {
text-decoration: none;
color: black;
}
a:active {
color: black;
}
@media screen and (max-width: 400px) {
.content {
width: 100%;
}
.pull {
width: 50%;
}
.pull:hover {
width: 90%
}
}
</style>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
</head>
<body background="index_background.png">
<div class="content" align="left">
<section class="trench-bold">/The Goust Server</section>
<br>
<a href="downloads.html"><div class="pull">Downloads</div></a>
<a href="links.html"><div class="pull">Links</div></a>
<a href="links.html"><div class="pull">About</div></a>
<br><br><br><br>
<section class="trench-bold">/Pages</section>
<br>
<a href="samsworld.html"><div class="pull">Sam's World</div></a>
</div>
</body>
【问题讨论】:
-
当您扩展到移动视图时,您希望看到哪些实际变化?
-
我想要'下载','链接','关于'和'sam的世界'来扩展到手机,所以选择按钮时,它们将扩展到90%的时间屏幕。我还希望文本可以缩放。
标签: html css media-queries responsive