基本上我想爲多個設備(桌面,iphone,ipad和其他瀏覽器的智能手機)創建網頁。我剛剛開始學習css3,學習css3媒體查詢非常混亂。
我讀了一些教程,下面的代碼是我想出的。如果我正在做這件事,或者是否有任何更正應該進行,有人能讓我知道嗎?如何創建一個完全設備兼容的網站
<!DOCTYPE html>
<html lang="en-US">
<head>
<!-- META -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<meta name="robots" content="noodp" />
<title>Home</title>
<!-- CSS RESET -->
<link rel="stylesheet" type="text/css" href="reset.css" media="all" />
<!-- TARGET SMARTPHONES -->
<link rel="stylesheet" type="text/css" href="" media="only screen and (min-device-width: 320px) and (max-device-width: 480px)" />
<link rel="stylesheet" type="text/css" href="" media="only screen and (min-width: 321px)" />
<link rel="stylesheet" type="text/css" href="" media="only screen and (max-width: 320px)" />
<!-- IPADS -->
<link rel="stylesheet" type="text/css" href="" media="only screen and (min-device-width: 768px) and (max-device-width: 1024px)" />
<link rel="stylesheet" type="text/css" href="" media="only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (orientation: landscape)" />
<link rel="stylesheet" type="text/css" href="" media="only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (orientation: portrait)" />
<!-- DESKTOP & LAPTOPS -->
<link rel="stylesheet" type="text/css" href="" media="only screen and (min-width: 1224px)" />
<!-- LARGE SCREEN -->
<link rel="stylesheet" type="text/css" href="" media="only screen and (min-width: 1824px)" />
<link rel="stylesheet" type="text/css" href="" media="only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-device-pixel-ratio: 1.5)" />
</head>
<body>
</body>
</html>
我會將你的條件樣式表壓縮成一個。 – Blender 2012-08-10 04:51:13
會凝聚樣式表搞砸我瞄準的智能手機 – JaPerk14 2012-08-10 05:16:35
不,只需使用媒體查詢CSS語法即可。 – Blender 2012-08-10 05:17:15