所以我試圖以我的目標爲響應式設計,並且看到了這個應該以所有iPhone爲目標的「簡單」媒體查詢。試過了,在Firefox和Chrome中測試過,結果都沒有成功。我在Firefox中使用了新的「響應式設計」工具,並沒有工作,所以然後我試圖調整大小的窗口也沒有工作。我也嘗試在Chrome中調整瀏覽器窗口大小,並且這也被證明是不成功的!任何幫助表示讚賞!首先是我的HTML:CSS3媒體查詢不起作用?
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>CSS Media Queries</title>
<link rel="stylesheet" type="text/css" href="test.css" media="screen">
</head>
<body>
<p>Hello there, if this is blue, the responsive css is not working, however if it is red, then it is working!</p>
</body>
</html>
現在我的CSS:
@media only screen and (max-width : 320px) {
body{
color:red;
}
}
body{
color:blue;
}
與非媒體查詢'媒體查詢一個前body'規則再次嘗試。 –