3

这一定是一个非常愚蠢的问题,但我无法让这个媒体查询工作。当我调整页面大小时,页面并没有改变。

样式表.css:

@font-face {
    font-family: ubuntu;
    src: url('Ubuntu-L.ttf');
}
@font-face {
    font-family: ubuntu;
    src: url("Ubuntu-B.ttf");
    font-weight: bold;
}

html, body {
background-image: url('bg2.png');
background-repeat: repeat;
background-attachment: fixed;
font-family: ubuntu;
font-size: 48px;
margin: 0;
padding: 0;
text-align: center;
}

#menu {
width:900px;
height: 150px;
background: #FFF;
position: fixed;
left: 50%;
margin-left: -450px;
top: 50px;
}


#content {
width: 800px;
margin: 0px auto;
padding-top: 100px;

}

.block {

width: 100%;
height: 800px;
margin-top: 100px;
margin-bottom: 100px;
border-radius: 5px;
background: #FFF;

-moz-box-shadow: 0 0 25px 0px rgba(0,0,0,0.5);
-webkit-box-shadow: 0 0 25px 0px rgba(0,0,0,0.5);
box-shadow: 0 0 25px 0px rgba(0,0,0,0.5);
}


//MEDIA QUERY

@media screen and (max-width: 900px) {

    #content {
        width: 90%;
    }
    #menu {
        width: 100%;
        left: 0%;
        top: 0%;
        margin-left: 0px;
    }

}

索引.html:

<html>
<head>

<link rel="shortcut icon" href="http://www.yellos.com/favi.ico" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<title>yellos</title>

<!--[if lt IE 9]>
    <script src="http://css3-mediaqueries-js.googlecode.com/svn/trunk/css3-mediaqueries.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="stylesheet.css" />

</head>

<body>

<div id="menu">

...

</div>

<div id="content">

<div class="block" id="1">

TEST

</div>

</div>

</body>

</html>

我究竟做错了什么?

4

1 回答 1

6

错误是//CSS 中不允许注释。

改变

//MEDIA QUERY

/* MEDIA QUERY */
于 2013-03-26T20:35:27.883 回答