Introduction background-size: cover; scales an image to cover entirely the background of a target element (the body of this page is styled this way). background-size: contain; scales an image to make it as big as possible but always entirely visible (or contained) in the background of a target element (this box is styled this way). background-size is available in IE9+, Firefox, Chrome, Safari and
CSS3ããå°å ¥ãããbackground-sizeé常ã«ä¾¿å©ãªããããã£ã§ãã ããããããã°background-imageã«è¨å®ããç»åã®ãµã¤ãºãå¤æ´ãæ¾é¡ããããIE8ã§ã¯å¹ãã¾ããã ãªãã¨ãããã°ã filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='èæ¯ç»åã®ãã¹',sizingMethod='scale'); ã¨æå®ããã¨ãbackground-size: 100% 100% ã«è¿ãåããå®ç¾ã§ãã¾ãã jQueryã®ãã©ã°ã¤ã³ãã¤ãã jquery.backgroundSize.js ãã¤ããã¨JSã®åã§è§£æ±ºã§ãã¾ãã jquery.backgroundSize.js
縦横æ¯çã決ã¾ã£ã¦ããªãç»åãã·ã¹ãã ã§ã©ã³ãã ã«è¡¨ç¤ºããéãªã©ãæ¨ªå¹ (width)ããã¯ã»ã«ããã¼ã»ã³ãã§åºå®ãã¦ç¸¦å¹ (height)ããautoãã«ããã¨ä¾¿å©ã§ãããInternetExplorer8ã§ã¯é«ãã0ã¨èªèããã¦ãã¾ããæ½°ããç»åã«ãªã£ã¦ãã¾ãã¾ãã IE8ã§ç»åã®heightãautoã§è¡¨ç¤ºãããªãæã®å¯¾å¦æ¹æ³ã¯ä»¥ä¸ããã ä¸è¨ã®æ§ãªè¨è¿°ã§ã¯ã¤ã³ã¿ã¼ãããã¨ã¯ã¹ããã¼ã©ã¼8ã§ã¯ç»åã表示ããã¾ããã img { width: 100%; height: auto; } ä¸è¨ã®æ§ã«ãwidthãå±æ§ããinheritãã«å¤ããæ°ãã«ãmax-widthãå±æ§ãã100%ãã¨æå®ããäºã§ãIE8ã§ãåé¡ç¡ã表示ããã¾ãã img { width: inherit; max-width: 100%; height: auto; } ãã¼ã»ã³ãå¤ã§ã¯ãªããã¯ã»ã«æ°ã§æå®ãããã¨ã
IEã§HTML5ãCSS3ã使ãå ´åãããã¤ãè£å©ããã°ã©ã ãèªã¿è¾¼ãã ããå¶ä½ä¸ã®æ³¨æç¹ãããã¾ããããã¯ããã¡ãã¨HTML5ãCSS3ã®ä»æ§ã身ã«ã¤ãã¦ããªãã¨ãåä½ããªãããªã©ã®ãã©ãã«ã«è¦èããããã¨ãããã¾ãã ãã®è¨äºã§ã¯ãããªããããããå¿ è¦ãããã®ãããããã³ã¨æ¸ãã¦ãä»æ§ã»ä»çµã¿ãç解ããä¸ã§ä½¿ãããªããã¨ãã§ããããã«ãªãäºãç®æ¨ã«æ¸ãã¾ããã IE8ã§ãHTML5ã®Sectionsã¿ã°ã使ããããã«ãããhtml5shiv.jsã ãSectionsã¿ã°ãã¨ã¯ä»¥ä¸ã®ã¿ã°ã§ããããã¯HTML5ã§å®ç¾©ããã¦ãã¾ãããIE8ã§ã¯ä½¿ããªããã®(HTML5ã§è¿½å ããå)ãããã¾ããããã使ããããã«ããã®ããhtml5shiv.jsãã§ãã section (HTML5ãã追å ) nav (HTML5ãã追å ) article (HTML5ãã追å ) aside (HTML5ã
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}