????? ???? ? ??? ?? ?? ?? ?? ?????.
<meta name="viewport" content="width=device-width, initial-scale=1.0">
?? ?? ? ?? ???? ?? ? ???? ??? ??? ??? ? ??? ?? ??????. ??? ?? ? ?? ??? ???? ???? ??? ?? ??? ?? ??? ?? ???? ?????.
?? 1: devicePixelRatio? ???? ?? ?? ??
? ???? ?? ??? CSS ??(px)? ???? ???. ? CSS ??? ?? ???? ??? ????. ? ??? ?? ??? window.devicePixelRatio? ?? ?????. ?? ????? 2×2 ??? ???? px? ?????. ? ??? ?? ??? px ?? ??? ?? ??? ???? ?? ??? ?? ? ?? ??? ??? ? ????. ??? ?? ?? ?? ?? ????? ???? ?? devicePixelRatio ?????.
裝置 | 解析度 | 像素密度 | devicePixelRatio 值 |
---|---|---|---|
OPPA A31 | 720×1600 | 270PPI | 2 |
Google Pixel 8a | 1080×2400 | 430PPI | 2.625(Chrome) |
Google Pixel 8a | 1080×2400 | 430PPI | 2.6087(Firefox) |
Windows 11 筆電 | 1920×1080 | N/A | 1 |
Windows 11 13.3 吋筆電 顯示比例 125% | 1920×1200 | N/A | 1.25 |
??? ????? ?????? ??? ?? ? ??? ? ? ????. ?????? ? ??? ???? ?? px ??? ?????.
?? 2: ??? ?? ??
????? ??? ?? ????? ???? ? ??? ? ?? ???? ? ?? ??? ?????. ? ??? 1???? ?? px ???? ?????. ??? ?? ???? ?? ?? ??? ???? ??? ??????.
??? ???? ?? ??? ?? ????, ??? 1?? 10000?? ??? ? ????. ?? ? ??? ?? ??, ??? ?? ?? ??? ????. ??? ???? ???? ???? ?? ????? ??? ?? ?? ??? devicePixelRatio? ??? ??? ??? px? ????? ?? ?? ??? ??? ? ????. ???? ??? ?? ????? ??? ?? ??? ??? ????? ?????. ???? ???? ?? ?? ???? 980???.
JavaScript??? ??? ?? ??? ???? ??? px ??? ?? ? ????.
屬性 | 說(shuō)明 |
---|---|
window.innerWidth | viewport 的寬度 |
window.screen.width | 裝置的螢?zāi)粚挾?/td> |
?? 3: ???? ??
???? ? ? ???? ?? ? ??? ? ????. ??? ??? ?? ??? ???? ?? ??? ? ??/?? ??(0.1~10.0)? ???? ????. ???? ??? ????? ????? ???? ?? ?? ???? ??? ? ?? ?? ? ??? ???? ??? ?????.
?? ????? ???? ???? ?? ?? ?? ??? 980px???. ?? ??? ? Google Pixel 8A? Firefox? ???? ?? ??? 1080/2.6087 = 414px?? ????? ??? ? ???? ?? ???? ??? ????? ? ???? 414/980 =42.2%? ???? ??? ??? ?? ??? ?? ? ?? ???.
??? ?? ????? ?? ??? ???? ???? ??? ? ?? ?? ??/?? ??? ??? ?? ????. ???? 0.1???. ? ???? ?? ???? ??? ???? ?? ?? ??/?? ??? ?? ??? ??? ???? ? ?? ?? ?? ??? ?????. ?, ??/?? ??? ?? ???? ??? ???? ?? ? ????. ????? ??? ? ????. ?? ??? ???? ?? maximum-scale? ??? ?? ????. ???? 10???. ?? ??? ?? ?? ??? 1/0 ?? ?/???? ???? ???? ??/??? ? ??? ??? ??? ??? ? ????.
JavaScript??? ??? ?? ?? ???? ??/?? ??? ?? ? ????.
屬性 | 說(shuō)明 |
---|---|
window.visualViewport.scale | viewport 目前的縮放倍數(shù) |
?? ??
????? ?? ???? ?? ?? ????? ?????.
<meta name="viewport" content="width=device-width, initial-scale=1.0">
???? Firefox
???? Firefox? ??? ?? ?????.
???? ??? ?? ???? ?? ??? 646px?? ? ? ????. ??? ??? ???? ?? ??? ???? ????. ????? ???? ??? ??? ?? ??? ??:
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <script> window.addEventListener('load', function() { document.getElementById('devicePixelRatio').textContent = window.devicePixelRatio; document.getElementById('screenWidth').textContent = window.screen.width; document.getElementById('innerWidth').textContent = window.innerWidth; // 取得並顯示目前的縮放倍數(shù) function updateScale() { const currentScale = window.visualViewport ? window.visualViewport.scale : '不支援'; document.getElementById('currentScale').textContent = currentScale; } // 初始化顯示 updateScale(); // 監(jiān)聽(tīng)縮放變化 if (window.visualViewport) { window.visualViewport.addEventListener('resize', updateScale); } }); </script> 1 2 3 4 5 6 7 8window.devicePixelRatio =window.screen.width =window.innerWidth =目前縮放倍數(shù) =
???? ?? ??? ??? ??? ????. ?, ?? ???? ??????? ??? ?? ??? ??? ????.
???? Firefox
???? ???? ?? ?? ?? HTML ???? ??? ??? ???? ?????.
<meta name="viewport" content="width=1200, initial-scale="1.0">
???? Firefox? ??? ?? ?????.
??? ??? ???? ??? ????.
?? ??? ??? 980??? ? ???? ?? ???? ??? ???? ?? ? ???? ?? ???? ????? ???? 0.4224?? ?????. ? ??? ?? ??? ???? 0.1?? ??, ???? ?? ??? ?????? ?? 0.4224???? ??? ? ????.
???? ??? ??? ??? ??
??? ??? ?? ???? ??:
<!-- <meta name="viewport" content="width=device-width, initial-scale=1.0"> -->
???? ??? ??? ????.
??? ??(window.innerWidth)? ?? ?? ??(window.screen.width)? ?? 414px? ?? ??? ? ???, ????? ? ??? ?????. ??/?? ??? 1???. ?? ??? ? ??? ??? ???? ????. ?? ? ???? ?? ???? ??? ? ?? ?? ??/?? ????? ?? ?? ??? 0.1? ?????. ???? ???? ?? 1???? ??/??? ? ????.
?? ??/?? ?? 1? ????? ??? ?? ??? ??? ???? ?? ??:
<meta name="viewport" content="width=device-width, initial-scale=1.0">
?? ??? ??? device-width? ??? ?? ????.
??? ??? ????? ??
??? ??? ????? 980?? ??? ??:
<meta name="viewport" content="initial-scale=1.0">
? ??? ?? ?????.
?? ???? ??? ???? ???? ??? ?? ? ?? ??? ?????. ?? ??? ????? ?? ??? ??? 980?? ??? ? ????.
??? ?? ????? ??? ??? ???? ?? ??? ??:
<meta name="viewport" content="width=device-width, initial-scale=1.0">
????? ?? ??? ?? ?? ??? ??? ????? ?? ??? ??? ?? ??? ??? ?? ?????.
??? ??? ???? ?? ??? ???? ?? ?? ??? ????.
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <script> window.addEventListener('load', function() { document.getElementById('devicePixelRatio').textContent = window.devicePixelRatio; document.getElementById('screenWidth').textContent = window.screen.width; document.getElementById('innerWidth').textContent = window.innerWidth; // 取得並顯示目前的縮放倍數(shù) function updateScale() { const currentScale = window.visualViewport ? window.visualViewport.scale : '不支援'; document.getElementById('currentScale').textContent = currentScale; } // 初始化顯示 updateScale(); // 監(jiān)聽(tīng)縮放變化 if (window.visualViewport) { window.visualViewport.addEventListener('resize', updateScale); } }); </script> 1 2 3 4 5 6 7 8window.devicePixelRatio =window.screen.width =window.innerWidth =目前縮放倍數(shù) =
??? ?? ??/?? ??? 1.0? ???? ????.
1?? ? ?? ??? ?????.
??/?? ??? ???? ????? ?? ??? ? ??? ??/?? ??? ??? ? ????. ?:
<meta name="viewport" content="width=1200, initial-scale="1.0">
??? 3?? ??? ?? ? ? ????:
?? ??? ? ???? ?? ??? ?? ????? ??? ???? ? ???? ?? ?????? ? ???? ?? ??/?? ??? ?? ??? ??/?? ?? ?? ?? ???? ?????. , ?? ??/?? ??? ?????. ??? ?? ??? ???? ?? ? ?? ?? ?? ???? ?? ?? ????. ??? ??? ?? ??? ???? ?? ??? ???? ?? ? ????.
??? ???? ????? ???? ??? ??? ?? ??? ???? ??? ???? ???? ???? ???? ? ?????.
?? ??? 1?? ?? ?????.
?? ??? 1?? ?? ??? ?? ????. ?, ?? ??? ?????. ??? ??? ??? ????? ???? ?? ???? ???? ??????? ????? ??? ???? ???. ? ???? ?? ?? ???? ??? ? ?? ?? ??? ?????. ?? ??? ??? ??? ?? ??? ???? ??? ? ???? ?? ??? ??? ? ??? ?? ???? ??? ? ????. . ?? ?? 0.5? ??? ??:
<!-- <meta name="viewport" content="width=device-width, initial-scale=1.0"> -->
? ???? ??? 414/0.5=828px? ?????.
??? ???? ??? ?????.
??? ?? ?? ??? ??? ?? ???? ?? ??? ??? ?????. ?:
<meta name="viewport" content="width=device-width, initial-scale=1.0">
??? ??? ????.
??? ???? ?? ?? ? ? ????.
?? ??
? ???? ???? ??? ???? ???? px ??? ????? devicePixelRatio? 2? ????? 200×200 ???? 400×400? ???. ??? ??? ?????. ?? ??, ?? ???? ?? ??? ??????:
<meta name="viewport" content="width=device-width, initial-scale=1.0">
584×604 ??? ??????:
?????? ??? ?? ??? ?????.
???? ? ?? ??? ?? ??? ????? ?? ???? ??? ????? ??? ??? ?? ????? 4? ??? ? ?? ?? ?????. ? ?? ???? ?? ? ?? ??? ?? ??? ??? 1.0?? ?? ? ???, ??? ?? ??? ??? ? ?? ???? ???? ?? ? ????.
? ????? 0.749?? ???????.
??? ??? ??? ???? ??? ??? ??? ??:
?? ??? ??? ?? ?? ? ? ????. ?? ?? ? ??? 4? 5? ? ?? ?? ??? ???????. ?? ??? ??? ???? ?????.
? ??? HTML ?? ??? ??? ??? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

CSS?? ????? ??? ? ?? ??? ????. 1. HTML ? CSS? ?? ??? ?????? ???? ?? ???? ?? ???? ??????. 2. ?? ??? ??? ?? ???? ???? ?? ?? ??? ?? ?? ??? ??????. 3. ??? ????? ???? JavaScript? ?? ???? ?????? ??? ?????. ? ?? ??? ??? ??? ????? ?? ??, ??, ??? ? ?? ???? ?? ?? ?? ??? ???? ?????.

CSS ???? ??? ? ??? ??? ????? ???? ??? ???? ???? ?? ?? ???? ????? ???????. 1. Flexbox ? ??? ??? ?? ???? ??? ??, ?? : ??? ?? ? ????? ??? ????. 2. Caniuse ?? ?? ?? ??? ??????. 3. -webkit-, -moz-, -ms-, -o- ? ?? ???? ???? ???? ?????. 4. AutoPrefixer? ???? ???? ???? ???? ?? ????. 5. ?? ????? ????? PostCSS? ???? BrowsersList? ??????. 6. ?? ? ???? ???? ?????. 7. Modernizr ?? ??? ??? ????? ??? ? ????. 8. ?? ????? ???? ?? ? ??? ????.

themaindifferencesbetweendisplay : ???, ??, andinline-blockinhtml/cssarelayoutbehavior, spaceusage ? stylingcontrol.1.inlineElementsFlowWithText, do n'tStartonnewlines, ingorewidth/height, andonlyapplyhorizontalpadding/margins —IdealforIneTeTexting

??? ?? ???? ???? ??? ??, ?? ??? ??? ? ? ????? ??? ??? ???? ???? ? ? ?? ? ? ????. 1. CSS ?? : ?? ??? ???? ???? ?? ??; 2. ????? ?? ?? ?? ???? ?? ?? ??? ??? ? ????. 3. ?? ??? ??? ??? ??? ?? ?? ???? ????????. 4. ??? ????? ??? ???? ?? ? ??? ??? ?? ??? ?? ?? ??? ????? ???? ?? ????.

CSS? ?? ?? ??? ??? ??? ???? ???? SVG? ???? ?? ???, ?? ????, ??? ?? ?? ??? ?? ???? ??????. ??? ??? ????. 1. ?, ??, ??? ?? ?? ??? ?? ??? ?????. 2. ?? ?? ? ??? ???? ??? ? ????. 3. ?????? ?? ?? ?? ?? ????? ???? ?? ??? ?? ? ? ????. 4. ???? ???? ??? ??? ??? ????? ?? ? ??? ????. ???? ???? ?? ?? ?? : ? (50pxatcenter) ? ??? ?? ?? : ??? (50%0%, 100 0%, 0%)? ?? ????. ????

thecspaintingapienablesDynamicAmageGenerationIncsSusingjavaScript.1.DevelopersCreateApaIntWorkletClasswitHapaint () ??? () ???

CSS? ???? ?? ? ???? ???? ??? ?? ??? ?? ?? ?? ? ? ????. 1. Max width : 100% ? ?? : Auto? ???? ???? ??? ????? ???? ??? ??? ? ??????. 2. HTML? SRCSET ? ?? ??? ???? ?? ??? ??? ??? ??? ???????????. 3. ?? ?? ? ?? ??? ???? ??? ??? ? ?? ?????? ??????. ? ??? ?? ???? ?? ???? ???? ???? ????????.

?? ????? CSS ?? ??? ????? ?? ?? ??? ??, ?? ?? ?? ??, Flexbox ? ??? ???? ?? ?? ? ?? CSS ??? ????? ??? ???? ???? ?? ????? ??? ?????. 1. ?? ??? ??? ???? ????. ???? CSSRESET ?? NALLER.CSS? ???? ?? ???? ???? ????. 2. IE? ?? ??? ?? ?? ?? ??? ????. ?? ?? : ?? ? ???? ??? ??? ???? ?? ????. 3. Flexbox ? Grid? Edge Case ?? Old ???? ??? ?????. ? ?? ??? ? AutopRefixer ??; 4. ?? CSS ?? ??? ???? ????. Caniuse? ???? ?? ?????????.
