【发布时间】:2020-12-25 18:54:19
【问题描述】:
CSS 适用于桌面 Chrome、Edge 甚至 IE。但它不适用于任何移动浏览器。我在 Android 版本 10 Chrome 和本机浏览器上进行了尝试。 CSS 文件与 HTML 文件位于同一文件夹中,名为 style.css。 这是HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Тэнэг Сда</title>
<link rel="stylesheet" type="text/css" href="./style.css">
</head>
<body>
</body>
</html>
footer{
padding: 15px;
margin-top: 20px;
color: #ffffff;
background: #e8491d;
text-align: center;
}
@media(max-width: 768px){
header .branding,
header nav,
header nav li,
.newsletter h1,
.newsletter form,
.boxes .box,
article.main-col,
aside.sidebar,
aside.sidebar-2{
float: none;
text-align: center;
width: 100%;
}
article.main-col .main-col2{
background-color: #ffffff;
color: black;
}
.newsletter button{
display: block;
width: 100%;
}
.quote button{
width: 93%;
}
.newsletter form input[type="email"]{
width: 98%;
margin-bottom: 5px;
}
header nav{
padding: 15px 0 10px 0;
}
header{
padding-bottom: 20px;
}
.showcase h1{
margin-top: 20px;
font-size: 40px;
}
}
【问题讨论】:
-
它包含什么
-
你在使用任何媒体库吗?
-
是的,我在 CSS 文件中使用媒体查询
-
向我们展示 css 文件
-
@DCR 它不允许我发布完整的 css 代码文件,所以我只是添加了带有媒体查询的部分