ããã«çŽé¢ããŸãããã Mozillaã¯éçºè åãã«éåžžã«å€ãã®ã¢ã«ãã¡çã ãã€ããªãŒãã«ãçããªãªãŒã¹çãäœæããŠãããããæè¿ãªãªãŒã¹ãããããŒãžã§ã³ïŒ Firefox 3.6ã¢ã«ãã¡çïŒã«ãŸã 泚æãæã£ãŠããªããã°ãååã«ç解ã§ããŸãã
ããããä»åã¯ã ãªã¿ã¯ã®æ³šç®ãéããããšã«éåžžã«èª¬åŸåããããŸããã ä»ã®ç©æ¥µçãªé©æ°ã®äžã§ããä¿®æ£ã«ã¯ä»¥äžãå«ãŸããŸãã
- ããããã£-moz-background-size
- è€æ°ã®èæ¯ç»å
- é·ãremã®æ°ããåäœ
- CSSã°ã©ããŒã·ã§ã³
- 衚瀺ã®æ¹åïŒããŒãã«ãã¥ãŒ
ããã§ã¯ãç¶æ³ãæ確ã«ããããã«éèŠãªãã€ã³ããäœããŸããã-ããã¯ãŸã ã¢ã«ãã¡çã§ããããããŸã§ã®ãšãããFirefoxãŠãŒã¶ãŒããŒã¹ã®æå°ã®å²åã®ã¿ã䜿çšããŸãã ããã«ããããããã幎æ«ã«Firefoxã®å®å®çã§ãããã®å€æŽã確èªããæ©äŒããããŸãã
è€æ°ã®èæ¯ç»å
èªå€§å®£äŒã«ãããããããMozillaãæåã«-moz-border-radiusãå°å ¥ãããšã-åçŽãªCSSããããã£ã§äžžãè§ãäœãããšãã§ããŸã-ç§ã¯å人çã«è奮ããŸããã§ããã
ããã©ããããèæ¯ç»åã®å€æ§æ§ã®æŠå¿µãçŽæããæ©äŒã«åžžã«ã·ã§ãã¯ãåããŸãã-æŽç·Žãããã¬ã€ã¢ãŠãã«åºå·ããããšãªã ãã¬ã€ã¢ãŠãäžã®ããã€ãã®åçŽãªå£®å€§ãªããªãã¯ã«ãã£ãŠå®è¡ãããŸããã
åºæ¬çãªæ§æã¯éåžžã«ç°¡åã§ãã background-imageããããã£ã§1ã€ã®ç»åã®ã¿ãæå®ãã代ããã«ãæ倧4ã€ã®ç»åãã³ã³ãã§åºåã£ãŠãªã¹ãããŸãã
background-repeatããã³background-positionã«å¯Ÿå¿ããæ倧4ã€ã®å€ãæå®ããããšãã§ããŸãã
#multi {
background-imageïŒurlïŒpaper.pngïŒãurlïŒpaper2.jpgïŒ;
ããã¯ã°ã©ãŠã³ããªããŒãïŒç¹°ãè¿ããªããç¹°ãè¿ããªã;
ããã¯ã°ã©ãŠã³ãäœçœ®ïŒå·Šäžãå³äžã
}
ããäžèªç¶ãªãœãŒãé ãçºèŠãããšèšããããåŸãŸããã 2çªç®ã®ã€ã¡ãŒãžã¯æåã®ã€ã¡ãŒãžã®äžã«ãªã¹ãããã以éãåæ§ã§ãã ããããããªããæããŠèŠãããšããã«ãåé¡ã¯ãããŸããã
ããŠãã©ã®ãã©ãŠã¶ããã®ããããã£ããµããŒãããŠããŸããïŒ
çŸæç¹ã§ã¯ãè€æ°ã®èæ¯ç»åã¯ãSafari 4.0ãChrome 3.0ãããã³Firefox 3.6 alphaïŒMinefieldïŒã§ã®ã¿å®å šã«ãµããŒããããŠããŸãã 次ã®URLã§ãããã®ãã©ãŠã¶ã®ããããã«ã¢ã¯ã»ã¹ãããšãå®éã®ç§ã®äŸãèŠãããšãã§ããŸãã
http://www.sitepoint.com/examples/css3/multi.html
ããŠãä»ãã®ããããã£ã䜿çšãã䟡å€ã¯ãããŸããïŒ
ç°ãªããã©ãŠã¶ã§ã³ãŒãã®è¡šç€ºããã§ãã¯ãããšãã«æåã«ééããåé¡ã®1ã€ã¯ããªã¹ãã®æåã®ç»åã®ã¿ãæåŠããæ®ããç¡èŠããããšã§ããã ãããã®ãã©ãŠã¶ã§å®£èšå šäœãåé€ããã«ã¯ãã³ã³ãã§ååã§ããèæ¯ã¯ç©ºã®ãŸãŸã§ãã
ãã ããèæ¯ç»åããã¹ãŠã®æšæºã«æåã«å®£èšãããšãOperaãFirefoxããã³Safariã®å€ãããŒãžã§ã³ã¯ãã³ãŒãå ã§ããã«é²ãå¯èœæ§ã®ããæ°ããCSSåºåãç°¡åã«ç¡èŠããããšãããããŸããã
Internet Explorerããã®ã«ãŒã«ã«åŸãããšãæåŠãããšããäºå®ã¯ãIEã§å®è¡ãããåçŽãªåäžç»åã³ãŒãã匷å¶ããæ¡ä»¶ã§ã³ã¡ã³ããèªç±ã«äœ¿çšã§ãããããåé¡ã§ã¯ãããŸããã
<ïŒ-[IEã®å Žå]>
<style type = "text / css">
#multi {
background-imageïŒurlïŒold-paper2.jpgïŒ;
background-repeatïŒç¹°ãè¿ããªã;
èæ¯ã®äœçœ®ïŒå·Šäž;
}
</ style>
<ïŒ[endif]->
äžè¬ã«ããã®ããããã£ã¯å®çšçã§ãããä»æ¥ã§ãçµæãåŸããããšæããŸãããåªé ã«äœ¿çšããã«ã¯éåžžã«æ³šæããå¿ èŠããããŸãã
ãã¶ã€ã³ãå€ããã©ãŠã¶ã§æ£åžžã«æ©èœããããšã確èªããŠãã ããïŒæçµçã«ã¯ãããªããæªåãããããšã¯ãããŸããïŒããæ°ãããã©ãŠã¶ã®ãŠãŒã¶ãŒãå¢ãç¶ããäžã§ããã¶ã€ã³ã«ããã«è±ªè¯ãªã¿ãããè¿œå ããŸãã ããã§ã¯ãå®éšã®æéã§ãã
èæ¯ç»åã®ãµã€ãºãèšå®ãã
ã¿ã€ãã«ããæšæž¬ã§ããããã«ãbackground-sizeã䜿çšãããšãCSSã䜿çšããŠè¿œå ãããç»åãèæ¯ã«æ¡å€§çž®å°ã§ããŸãã
å®éãä»ã§ã¯background-sizeããããã£ã¯ãã€ãã£ãCSS3圢åŒãé€ããã¹ãŠã®å Žæã§ãµããŒããããŠããŸããããOperaãChrome / SafariãFirefox 3.6 alphaã¯ãµããŒãããŠããŸãããããããç¬èªã®ããŒã¯ã¢ããããããŸãã
ããŒã¯ã¢ããã¯æ¬¡ã®ãšããã§ãã
body {
background-imageïŒurlïŒbackground_image.jpgïŒ;
èæ¯ãµã€ãºïŒ50ïŒ 50ïŒ ; / * w3cä»æ§* /
-moz-background-sizeïŒ50ïŒ 50ïŒ ; / * firefox css * /
-webkit-background-sizeïŒ50ïŒ 50ïŒ ; / *ãµãã¡ãª/ã¯ãã * /
-o-background-sizeïŒ50ïŒ 50ïŒ ; / *ãªãã©css * /
}
ãããã®ãã©ãŠã¶ãŒã®ããããã䜿çšããŠããå Žåããã®ã³ãŒãã®åäœãããã§ç¢ºèªã§ããŸã ã
ããã§ãä»ãã䜿çšã§ããŸããïŒ
ç¹°ãè¿ããŸãããçãçãã¯ã€ãšã¹ã§ãã ãšã«ããããã®ããã«ã¿ãŒã²ãããçµã£ã宣èšã¯ãä»ã®ãã©ãŠã¶ãŒã§ã¯åã«ç¡èŠãããããããã®ããããã£ã䜿çšããããã®æè¡çãªé害ã¯ãããŸããã
å人çã«ã¯ããã®ããããã£ãæ£ç¢ºã«é©çšãããå Žæã¯æ確ã§ã¯ãªãããã§ããããã¯ãããªãŒã¹ã±ãŒãªã³ã°ã«é©ããç»åãã»ãšãã©ãªãããã§ãã
ãããã£ãŠããã®ããããã£ã䜿çšãããã°ãããäŸãäœæãããªã¹ã¯ããŸã ããå Žåã¯ãããªãã®äœåãã芧ãã ããã
CSSã°ã©ããŒã·ã§ã³
CSSããã¯ã°ã©ãŠã³ãã°ã©ããŒã·ã§ã³ã¯ãçŸæç¹ã§ã¯Firefoxã¢ã«ãã¡ãSafari 4ãChrome 3ã§ã®ã¿ãµããŒããããŠããŸãããæãé©æ°çãªã€ãããŒã·ã§ã³ã®ããã«æããæ©èœã§ãã
background-sizeããããã£ã³ãŒããšåæ§ã«ãèæ¯ã°ã©ããŒã·ã§ã³ã³ãŒãããã©ãŠã¶ã«äŸåããŸãããåã³ãã³ãã¯å®å šã«æ°ããCSSããããã£ãäœæããã®ã§ã¯ãªããbackground-imageæšæºã®æ°ããå€ãè¡šããŸãã
æãåçŽã«ããã®ããããã£ã¯æ¬¡ã®ããã«ãªããŸãã
divïŒcssgradient2 {
èæ¯ç»åïŒ-moz-linear-gradientïŒäžãäžãïŒïŒA1D004ïŒããïŒïŒ6B9A00ïŒïŒ;
èæ¯ç»åïŒ-webkit-gradientïŒç·åœ¢ãå·Šäžãå·Šäžãè²æ¢ãïŒ0.00ãïŒA1D004ïŒãè²æ¢ãïŒ1.00ãïŒ6B9A00ïŒïŒ;
}
äžèšã®ããã«ãMozillaïŒFirefoxïŒãšWebKitïŒSafari / ChromeïŒã®ã³ãŒãã¯äŒŒãŠããŸãããåäžã§ã¯ãããŸããã ã©ã¡ãããã°ã©ããŒã·ã§ã³ã®è²éå§ãšè²åæ¢ãããã³æ¹å座æšïŒäžãå·Šãå³ãäžãªã©ïŒãå¿ èŠãšããŸãã
WebKitãšMozillaã¯ã©ã¡ããæŸå°ç¶ã°ã©ããŒã·ã§ã³ãšç·åœ¢ã°ã©ããŒã·ã§ã³ã®äž¡æ¹ã衚瀺ã§ããŸããããããã®æ¹æ³ã¯ç°ãªããŸãã Mozillaã2ã€ã®ç°ãªãããããã£å€ïŒ-moz-linear-gradientïŒïŒã-moz-radial-gradientïŒïŒãªã©ïŒã䜿çšããããšã奜ãå ŽåãWebKitã¯åäžã®å€ã䜿çšããŸãããç¹å¥ãªãã©ã¡ãŒã¿ãŒïŒããšãã°ã-webkit-gradientïŒradial ã...ïŒïŒ
ããã«ç°¡åã«ããããã«ããã¹ãŠãèªåã§æ€èšã§ãããã¹ãããŒãžãäœæããŸããã
CSSã°ã©ããŒã·ã§ã³ã®è¡šç€ºã«ã¯æäœ2è²ãå¿ èŠãªã®ã§ãã©ã¡ãã®æ¹æ³ã§ãå€ãã®è²ã䜿çšããŠããŒãžã«è€éãªã°ã©ããŒã·ã§ã³ãäœæã§ããŸãã
ãããã£ãŠãè¹è²ã®ã°ã©ããŒã·ã§ã³ãäœæããããã®æ§æã¯æ¬¡ã®ããã«ãªããŸãã
/ *ãã©ãŒã«ããã¯* /
èæ¯ïŒïŒF66 urlïŒrainbow-gradient.jpgïŒ;
/ * mozilla gradient * /
èæ¯ç»åïŒ-moz-linear-gradientïŒå·Šãå³ã
ïŒèµ€ïŒããã
ã«ã©ãŒã¹ãããïŒ16ïŒ ããªã¬ã³ãžïŒã
ã«ã©ãŒã¹ãããïŒ32ïŒ ãé»è²ïŒã
ã«ã©ãŒã¹ãããïŒ48ïŒ ãç·ïŒã
ã«ã©ãŒã¹ãããïŒ60ïŒ ãéïŒã
ã«ã©ãŒã¹ãããïŒ76ïŒ ãã€ã³ãã£ãŽïŒã
toïŒvioletïŒïŒ;
/ * webkitã®åŸé * /
èæ¯ç»åïŒ-webkit-gradientïŒç·åœ¢ã
å·Šäžãå·Šäžã
ã«ã©ãŒã¹ãããïŒ0.00ãèµ€ïŒã
ã«ã©ãŒã¹ãããïŒ16ïŒ ããªã¬ã³ãžïŒã
ã«ã©ãŒã¹ãããïŒ32ïŒ ãé»è²ïŒã
ã«ã©ãŒã¹ãããïŒ48ïŒ ãç·ïŒã
ã«ã©ãŒã¹ãããïŒ60ïŒ ãéïŒã
ã«ã©ãŒã¹ãããïŒ76ïŒ ãã€ã³ãã£ãŽïŒã
ã«ã©ãŒã¹ãããïŒ1.00ããã€ãªã¬ããïŒïŒ;
èå³æ·±ãã®ã¯ãIEã¯ãIE5以éã«ååšããŠãããã£ã«ã¿ãŒããããã£ã䜿çšããŠãåæ§ã®åçŽãªã°ã©ããŒã·ã§ã³ïŒè¹ãå«ãïŒã衚瀺ã§ããããšã§ãã
ãããã£ãŠãIEã«åªããã³ãŒãã¯æ¬¡ã®ããã«ãªããŸãã
ãã£ã«ã¿ãŒïŒprogidïŒDXImageTransform.Microsoft.gradientïŒ
enabled = 'true'ã
startColorstr =ïŒA1D004ã
endColorstr =ïŒ6B9A00ã
GradientType = 0
ïŒ;
ãã®ã³ãŒãã«ã€ããŠç¥ã£ãŠããã¹ãããšã2ã€ãããŸãã
ãŸãããã§ãããéå§è²ãšçµäºè²ãèšå®ãããŠããå Žæã確èªã§ããŸãã
第äºã«ãä¿¡ããããªããããããŸããããããŸãç¥ãããŠããªãGradientTypeãã©ã¡ãŒã¿ãŒãå®éã«ã°ã©ããŒã·ã§ã³ã®æ¹åãèšå®ããŸãã åçŽã°ã©ããŒã·ã§ã³ã®å Žåã¯0ã«ãæ°Žå¹³ã°ã©ããŒã·ã§ã³ã®å Žåã¯1ã«èšå®ããŸãã ç§ã®ç¥ãéããIEã§ã¯ãæãã®ã°ã©ããŒã·ã§ã³ãäžéè²ãèšå®ããããšã¯ã§ããŸããã
CSSã°ã©ããŒã·ã§ã³ã䜿çšããããšã«ã¯3ã€ã®å©ç¹ãããããã«æããŸãã
- ç»åãšã¯ç°ãªããCSSã°ã©ããŒã·ã§ã³ã¯ããããå«ãèŠçŽ ã«æ¯äŸããŠæ¡å€§çž®å°ãããããããŒãžäžã®ã³ã³ãã³ãã®åäœã«å¿ããŠæ¡å€§ããã³çž®å°ã§ããŸãã
- CSSã°ã©ããŒã·ã§ã³ã¯éåžžã«å¹æçã§ããããæ°è¡ã®ã³ãŒãã§å¿ èŠãªããŒã³ã®å€§ããæè»ãªæ§é åé åãçæã§ããŸãã ããã¯ããŠãŒã¶ãŒã®ããŒãžã®èªã¿èŸŒã¿é床ã«å€§ãã圱é¿ããŸãã
- ã»ãã¥ãªãã£äžã®çç±ãã€ã³ã¿ãŒããããã£ãã«ã®åž¯åå¹ ã®åé¡ã®ããã«ããŠãŒã¶ãŒãç»åããããã¯ã§ããç¶æ³ã¯æ°å€ããããŸãã CSSã°ã©ããŒã·ã§ã³ã¯ãç»åã§ã¯è¡šçŸã§ããªãè€éãªè²ãäžããå¯èœæ§ãé«ããªããŸã-ããšãã°ãiPhoneã®Safariã
ã§ã¯ããã®ããããã£ãä»ãã䜿çšã§ããŸããïŒ
ç¹°ãè¿ãã«ãªããŸãããåççã«äœ¿çšã§ããéããã¯ããšçããŸãã
SafariãChromeãããã³Firefoxã®ææ°ããŒãžã§ã³ããã®æ©èœãååã«ãµããŒãããããšã¯æããã§ãã IEã¯ãåççã«èš±å®¹ã§ããåŸé ãµããŒããå®è£ ããŠããŸãã ãããŠãããã¯ãã©ãŠã¶ã®ã»ãŒååã§ãããFirefoxã®å®å®çããã€ãªãªãŒã¹ããããã«ã€ããŠãèšåããŠããŸããã
æ®ãã®ãã©ãŠã¶ã«ã¯ãåŸæ¥ã®æ¹æ³ã§èšå®ããã®ãšåãæ¹æ³ã§ã°ã©ããŒã·ã§ã³ãèšå®ããæ©äŒãåžžã«ãããŸãã
ãŸãšã
ãããã®ããããã£ãšã€ãããŒã·ã§ã³ã䜿çšããããšã«å¯ŸããŠå€ãã®è°è«ãããã ãã§ååã§ã-ãããã¯ãŸã æ©ãããŠãæè¡ã¯ãŸã çã®ãŸãŸã§ãã ããã«ãããããããã°ã©ããŒã·ã§ã³ãšè€æ°ã®èæ¯ç»åã¯ãå°æ¥ã®äž»èŠãªéçºè ã«ãšã£ãŠç¢ºãã«ããã¬ããã¢ã³ããã¿ãŒãã«ãªãã®ã§ããããã®ããŒã«ãããŸã䜿çšããã«ã¯ããããã®ããŒã«ã§è¯ãã²ãŒã ããã¬ã€ããå¿ èŠããããŸãã
ã²ãŒã ã®æéã¯ä»ã ãšæããŸãã
泚ïŒ
A /ç§ã®äžå®å šãªç¿»èš³ããaã³ããŸãã 誰ãããšã©ãŒã«æ°ã¥ããããã³ã¡ã³ããæžããŠãã ãããããã«ä¿®æ£ããŸãã
B /åå¿è ã¯èšäºãèªãããšãã§ããã®ã§ãã»ã¬ã¯ã¿ãŒãšå®£èšã«ã€ããŠç°¡åã«èª¬æããããšæããŸãã çšèªãå®çŸ©ããŸãããïŒ
p {
ãã©ã³ããã¡ããªïŒArialãHelveticaãsans-serifã
}
ããã§ãã»ã¬ã¯ã¿ã¯pã§ã
äžæ¬åŒ§{}ã®éã«ãããã¹ãŠã宣èšãããã¯ã§ã
ãã®å®£èšã¯ãã©ã³ããã¡ããªã§ããArialãHelveticaãsans-serifã
宣èšèªäœã¯ãããããã£-ãã©ã³ããã¡ããªãšå€-ArialãHelveticaãsans-serifã§æ§æãããŸã