繁体   English   中英

媒体查询为什么我的代码不被接受即无效

[英]Media Query why isnt my code not being accepted ie doesnt work

调整浏览器大小时,以下代码均无效

我也已经拥有@media内容之前的样式内容。 我不知道我已经尝试了一切。 但它只是无法正常工作,我使用了MAC Google chrome。

<html>
<head>
<title>Responsive Web Design</title>
<meta name= "viewport" content="width=device-width">    

 <link href="responsive.css" rel="stylesheet">    


<!-- css down below -->


@media screen and (max-width: 720px;){
nav ul{
max-height: 0;
}


nav ul li {
  box-sizing: border-box ;
  width:100%;
  padding: 15px;
  text-align: left;}

.handle { display:block;
Always write the Media Queries like this do not use semicolon(;) after declaring your width in media syntax

Example:

@media only screen and (min-width: 600px) {
    /*Responsive code goes here */
}
@media only screen and (min-width: 768px) {
/*Responsive code goes here */
}

您的问题是720px后的分号:

@media only screen and (max-width: 720px;)

您必须删除:

@media only screen and (max-width: 720px)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM