我不知道为什么我的媒体查询不起作用。
以下标记位于html中:
不知道还有什么问题吗?
感谢在座的每一个人。
问题是我的语法错误。我有太多“}”。
答案 0 :(得分:0)
您的代码中存在语法错误。您还有一个额外的}
,我已经删除了css下的使用。
css
html, body, main, header, h1, h2, h3, h4, h5, h6, p {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
font-family: Arial;
}
h1{
margin: 10px auto 0 auto;
font-size: 40px;
color: #000000;
font-family: 'Montserrat', sans-serif;
font-weight: bold;
text-transform: uppercase;
border-bottom: 2px solid #000000;
display: inline;
padding-bottom: 20px;
}
h2, h3, h4, h5, h6{
margin: 30px auto 0 auto;
font-size: 22px;
color: #000000;
font-family: 'Montserrat', sans-serif;
font-weight: bold;
display: inline;
}
.h1{
margin-top: 40px;
margin-bottom: 40px;
}
.h2{
margin-top: 40px;
margin-bottom: 20px;
}
p{
margin: 15px 0 15px 0;
font-size: 16px;
line-height: 23px;
color: #808080;
font-family: arial, verdana, sans-serif;
}
.bold{
margin: 15px 0 15px 0;
color: #f66958;
font-size: 16px;
line-height: 23px;
font-family: arial, verdana, sans-serif;
font-weight: bold;
}
p a:link, a:visited {
cursor: pointer;
color: #000000;
}
p a:hover{
transition: color 0.5s;
color: #b4b4b4;
}
.logo{
margin: auto;
padding: 0;
margin: 10px 0 0 0;
}
.logo img{
display: block;
margin: auto;
width: 100px;
padding: 0 15px 0 15px;
}
.logo a{
display: block;
width: 100px;
margin: 0 auto;
}
header{
margin: 0 auto;
background-color: #ffffff;
}
.nav-mobile{
width: 100%;
background-color: #ffffff;
}
.nav-mobile ul{
list-style-type: none;
font-size: 18px;
text-align: center;
line-height: 50px;
margin: 10px 0 8px 0;
padding: 0 25px 0 25px;
margin: 20px 0 20px 0;
background-color: #ffffff;
}
.nav-mobile ul li{
display: inline-block;
position: relative;
}
.nav-mobile ul li a{
margin: 0;
color: #000000;
text-decoration: none;
padding: 0 10px 0 10px;
}
.nav-mobile ul li a:hover{
color: #000000;
border-bottom: 2px solid #000000;
}
.nav-mobile ul li a:visited{
color: #000000;
}
.nav-desktop{
width: 100%;
background-color: #ffffff;
display: block;
}
.nav-desktop ul{
list-style-type: none;
font-size: 18px;
text-align: center;
line-height: 25px;
margin: 10px 0 8px 0;
padding-left: 15px;
padding-right: 15px;
background-color: #ffffff;
}
.nav-desktop ul li{
display: inline-block;
position: relative;
bottom: 30px;
}
.nav-desktop ul li a{
margin: 0;
color: #000000;
text-decoration: none;
padding: 0 10px 0 10px;
}
.nav-desktop ul li a:hover{
color: #000000;
border-bottom: 2px solid #000000;
}
.nav-desktop ul li a:visited{
color: #000000;
}
.nav-desktop ul a{
padding: 0 10px 0 10px;
}
.active{
color: #000000;
border-bottom: 2px solid #000000;
}
div.home-slide{
max-width: 1920px;
margin: auto;
}
div.home-slide img{
max-width: 100%;
margin: 0;
}
div.middle-col{
max-width: 1000px;
margin: auto;
margin-bottom: 100px;
padding: 0 20px 0 20px;
}
div.middle-col ul li{
margin: 8px 0 8px 0;
font-size: 16px;
line-height: 20px;
color: #231f20;
font-family: arial, verdana, sans-serif;
}
div.middle-col img{
margin-bottom: 10px;
}
.footer-nav{
text-align: center;
width: 100%;
padding: 0;
position: fixed;
bottom: 0;
left: 0;
z-index: 1024;
background-color: #000000;
font-size: 14px;
color: #000000;
margin: auto;
clear: both;
display: table;
margin-top: 0;
}
.footer-nav p, .footer-nav a, .footer-nav a:visited, .footer-nav a:link{
display: inline-block;
margin: 0 10px;
color: #ffffff;
}
.footer-nav img{
height: 35px;
position: relative;
top: 12px;
left: 5px
}
#book-here{
position: relative;
left: 5px
}
footer{
width: 100%;
font-size: 14px;
margin: auto;
clear: both;
display: table;
padding: 15px 0 25px 0;
margin: 0;
}
div.a p a:link, footer a:visited {
text-decoration: none;
}
div.a p a:hover {
text-decoration: underline;
}
div.a{
display: table-cell;
text-align: center;
vertical-align: middle;
}
div.a p{
}
.form .text{
font-size: 16px;
line-height: 25px;
color: #545454;
font-family: arial;
position: relative;
padding: 0;
bottom: 0;
}
@media screen and (max-width: 1000px) {
.nav-desktop{
display: none;
}
}