Front-end Job Interview Questions - CSS Questions ã®åçéã§ããææ¡ãèšæ£ã®ãã«ãªã¯ãšã¹ãã¯å€§æè¿ã§ãïŒ
- CSSã»ã¬ã¯ã¿ãŒã®è©³çŽ°åºŠãšã¯äœã§ããïŒã©ã®ããã«ã¯ããããŸããïŒ
- "ãªã»ãã" ãš "ããŒãã©ã€ãº" CSSã®éãã¯äœã§ããïŒããªãã¯ã©ã¡ãã䜿ããŸããïŒãããŠããã¯ãªãã§ããïŒ
float
ãšã¯äœã§ããïŒã©ã®ããã«ã¯ããããŸããïŒz-index
ãšã¯äœããšãã¹ã¿ãã¯ã³ã³ããã¹ã(ã¹ã¿ãã¯æè)ãã©ã®ããã«äœãããã®ããæããŠãã ããã- ãããã¯æŽåœ¢æèïŒBlock Formatting ContextãBFCïŒãšãã®ä»çµã¿ãæããŠãã ããã
- clear ãè¡ãææ³ã«ã¯ã©ã®ãããªãã®ããããããããã©ã®ãããªç¶æ³ã«é©ããŠããŸããïŒ
- CSSã¹ãã©ã€ããšã¯äœã§ããïŒããŒãžããµã€ãã«å®è£ ããæ¹æ³ãåãããŠèª¬æããŠãã ããã
- ãã©ãŠã¶åºæã®ã¹ã¿ã€ãªã³ã°ã«é¢ããåé¡ã解決ããã«ã¯ã©ãããã°ããã§ããïŒ
- æ©èœã®å°ãªããã©ãŠã¶ã«å¯ŸããŠã¯ãã©ã®ããã«ããŒãžãæäŸããŸããïŒã©ã®ãããªãã¯ããã¯/ããã»ã¹ã䜿çšããŸããïŒ
- ã³ã³ãã³ããèŠèŠçã«é ãïŒã¹ã¯ãªãŒã³ãªãŒããŒã®ã¿å©çšå¯èœã«ããïŒæ¹æ³ã«ã¯ã©ã®ãããªãã®ããããŸããïŒããã€ãæããŠãã ããã
- ã°ãªããã·ã¹ãã ã䜿çšããããšããããŸããïŒäœ¿ã£ãããšããããªããããªãã¯ã©ã®ã°ãªããã·ã¹ãã ã奜ãã§ããïŒ
- ã¡ãã£ã¢ã¯ãšãªãã¢ãã€ã«åºæã®ã¬ã€ã¢ãŠã/CSSã䜿çšãããå®è£ ããããšã¯ãããŸããïŒ
- SVGã®ã¹ã¿ã€ãªã³ã°ã«ã€ããŠã¯è©³ããã§ããïŒ
screen
以å€ã®@media
ããããã£ã®äŸãæããããŸããïŒ- å¹ççãªCSSãæžãã«ããã«é¿ããã¹ã "èœãšãç©Ž" ã«ã¯ã©ããªãã®ããããŸããïŒ
- CSSããªããã»ããµã䜿çšããã¡ãªãããšãã¡ãªãããæããŠãã ããã
- 䜿çšããããšã®ããCSSããªããã»ããµã«ã€ããŠå¥œããªãã®ãšå«ããªãã®ãæããŠãã ããã
- éæšæºãã©ã³ãã䜿çšããWebãµã€ããå®è£ ããã«ã¯ã©ã®ããã«ããŸããïŒ
- CSSã»ã¬ã¯ã¿ã«ãããããèŠçŽ ãã©ããªã®ãããã©ãŠã¶ãã©ã®ããã«æ±ºå®ããŠãããã説æããŠãã ããã
- ç䌌èŠçŽ ã«ã€ããŠèª¬æãããããããªãã®ããã«äœ¿ãããŠãããã詳ãã話ããŠãã ããã
- ããã¯ã¹ã¢ãã«ããªãã§ãããã®ããªãã®ç解ãšãããã¯ã¹ã¢ãã«ã§ã¬ã€ã¢ãŠããã¬ã³ããªã³ã°ããããã«CSSã§ãã©ãŠã¶ã«æ瀺ããè€æ°ã®æ¹æ³ã説æããŠãã ããã
* { box-sizing: border-box; }
ã«ãã£ãŠäœãèµ·ããŸããïŒãã®å©ç¹ã¯äœã§ããïŒ- CSSã®
display
ããããã£ãšã¯äœã§ããïŒãã®äœ¿ãæ¹ã®äŸãããã€ãæããããšãã§ããŸããïŒ inline
ãšinline-block
ã®éãã¯äœã§ããïŒposition
ãrelative
ãfixed
ãabsolute
ãstatic
ã®èŠçŽ ã®éãã¯äœã§ããïŒ- ããŒã«ã«ãæ¬çªç°å¢ã§ãã©ã®æ¢åã®CSSãã¬ãŒã ã¯ãŒã¯ã䜿çšããŠããŸããïŒãŸããã©ã®ããã«å€æŽ/æ¹åããŠããŸããïŒ
- CSSã«æ°ãã«å°å ¥ããã Flexbox ã Grid ã®ä»æ§ã§éãã ããšã¯ãããŸããïŒ
- ãŠã§ããµã€ããã¬ã¹ãã³ã·ãã§ã³ãŒãã£ã³ã°ããããšãšã¢ãã€ã«ãã¡ãŒã¹ãã§ã³ãŒãã£ã³ã°ããããšã®éãã説æã§ããŸããïŒ
- ã¬ã¹ãã³ã·ããã¶ã€ã³ã¯ã¢ãããã£ããã¶ã€ã³ãšäœãéããŸããïŒ
- Retina 察å¿ãè¡ã£ãããšã¯ãããŸããïŒãããããªãããã€ã©ã®ãããªãã¯ããã¯ã䜿ããŸãããïŒ
position: absolute
ã®ä»£ããã«translate()
ã䜿çšããã¹ãå Žåã¯ãããŸããïŒãã®éã®å ŽåããããŸããïŒçç±ãåãããŠæããŠãã ããã
ãã©ãŠã¶ã¯ãCSSã«ãŒã«ã®è©³çŽ°åºŠã«å¿ããŠèŠçŽ ã«è¡šç€ºããã¹ã¿ã€ã«ã決å®ããŸãããã©ãŠã¶ã¯ãç¹å®ã®èŠçŽ ã«äžèŽããã«ãŒã«ããã§ã«æ±ºå®ããŠãããšä»®å®ããŸãããããã³ã°ã«ãŒã«ã®äžã§ã詳现床ã¯ã以äžã«åºã¥ããŠãã«ãŒã«ããšã«4ã€ã®ã«ã³ãåºåãå€ãaãbãcãdããèšç®ãããŸãã
a
ã¯ãã€ã³ã©ã€ã³ã¹ã¿ã€ã«ã䜿çšãããŠãããã©ããã§ããããããã£ã®å®£èšãèŠçŽ ã®ã€ã³ã©ã€ã³ã¹ã¿ã€ã«ã®å Žåãa
ã¯1ãããã§ãªãå Žåã¯0ã«ãªããŸãã- bã¯IDã»ã¬ã¯ã¿ã®æ°ã§ãã
c
ã¯ã¯ã©ã¹ãå±æ§ãæ¬äŒŒã¯ã©ã¹ã»ã¬ã¯ã¿ã®æ°ã§ãã- ãdãã¯ã¿ã°ããã³æ¬äŒŒèŠçŽ ã»ã¬ã¯ã¿ã®æ°ã§ããã
åŸãããç¹ç°æ§ã¯ã¹ã³ã¢ã§ã¯ãªããåããšã«æ¯èŒã§ããå€ã®è¡åã§ããã»ã¬ã¯ã¿ãŒãæ¯èŒããŠç¹ç°æ§ãæãé«ããã®ãå€æãããšãã¯ãå·Šããå³ã«åãã£ãŠèŠãŠãååã®æé«å€ãæ¯èŒããŠãã ããããããã£ãŠãã«ã©ã b
ã®å€ã¯ãã«ã©ã cãšdã®å€ãäžæžãããŸããåŸã£ãŠãã0,1,0,0ãã®ç¹ç°æ§ã¯ãã0,0,10,10ãã®1ã€ãã倧ããã
çããç¹ç°æ§ã®å ŽåïŒææ°ã®ã«ãŒã«ã¯éèŠãªã«ãŒã«ã§ããã¹ã¿ã€ã«ã·ãŒãã«åãã«ãŒã«ãïŒå éšãŸãã¯å€éšã«é¢ä¿ãªãïŒ2åæžããå Žåãã¹ã¿ã€ã«ã·ãŒãã®äžäœã®ã«ãŒã«ã¯ã¹ã¿ã€ã«ãé©çšããèŠçŽ ã«è¿ããããå ·äœçã§ãããšã¿ãªãããé©çšãããŸãã
äœè©³çŽ°åºŠã®CSSã«ãŒã«ãäœæããŠãå¿
èŠã«å¿ããŠç°¡åã«äžæžãã§ããããã«ããŸãã CSSã®UIã³ã³ããŒãã³ãã©ã€ãã©ãªã®ã³ãŒããèšè¿°ããéã«ã¯ã詳现床ãäœãããšãéèŠã§ãã詳现床ãããããã«è€éãããCSSã«ãŒã«ã䜿çšããããïŒimportant
ãå©çšãããããšã¯é¿ããã¹ããªã®ã§ãã
- https://www.smashingmagazine.com/2007/07/css-specificity-things-you-should-know/
- https://www.sitepoint.com/web-foundations/specificity/
"ãªã»ãã" ãš "ããŒãã©ã€ãº" CSSã®éãã¯äœã§ããïŒããªãã¯ã©ã¡ãã䜿ããŸããïŒãããŠããã¯ãªãã§ããïŒ
- ãªã»ãã - ãªã»ããã¯ãèŠçŽ ã®ãã¹ãŠã®ããã©ã«ããã©ãŠã¶ã¹ã¿ã€ã«ãåé€ããããšãæå³ããŸãã äŸãã°ã
margin
ãpadding
ãfont-size
ã¯å šãŠåãèŠçŽ ã«ãªã»ãããããŸãã äžè¬çãªã¿ã€ãã°ã©ãã£ãŒèŠçŽ ã®ããã«ã¹ã¿ã€ãªã³ã°ãå宣èšããªããã°ãªããŸããã - ããŒãã©ã€ãº - ããŒãã©ã€ãºã§ã¯ããã¹ãŠãã解åãããã®ã§ã¯ãªããæçšãªããã©ã«ãã¹ã¿ã€ã«ãä¿æããŸãã ãŸããäžè¬çãªãã©ãŠã¶ã®äŸåé¢ä¿ã®ãã°ãä¿®æ£ããŸãã
ç§ã¯éåžžã«ã«ã¹ã¿ãã€ãºãããããŸãã¯æ £ç¿çã§ã¯ãªããµã€ããã¶ã€ã³ãæã£ãŠãããšãã«ãªã»ãããéžæããŠãèªåã®ã¹ã¿ã€ãªã³ã°ãããããè¡ãå¿ èŠããããããã©ã«ãã®ã¹ã¿ã€ãªã³ã°ãä¿åããå¿ èŠã¯ãããŸããã
Floatã¯CSSã®äœçœ®æ±ºãããããã£ã§ãã æµ®åèŠçŽ ã¯ããŒãžã®æµãã®äžéšãšããŠæ®ããããŒãžã®ãããŒããåé€ããããäœçœ®ïŒçµ¶å¯ŸãèŠçŽ ãšã¯ç°ãªããä»ã®èŠçŽ ïŒããšãã°ãæµ®éèŠçŽ ã®åšããæµããããã¹ãïŒã®é 眮ã«åœ±é¿ããŸãã
CSSã® clear
ããããã£ã¯ãleft
/right
/both
æµ®åèŠçŽ ã®äžã«é
眮ããããã«äœ¿çšã§ããŸãã
芪èŠçŽ ã«æµ®åå°æ°ç¹èŠçŽ ã ããå«ãŸããŠããå Žåããã®é«ãã¯äœãæããããŸããŸããã ããã¯ãæµ®åå°æ°ç¹æ°ã®åŸã®æµ®åå°æ°ç¹æ°ãã³ã³ããã®äžã§ãã³ã³ãããéããåã«ã¯ãªã¢ããããšã§ä¿®æ£ã§ããŸãã
.clearfix
ããã¯ã¯ãå·§åŠãªCSSç䌌ã»ã¬ã¯ã¿ïŒ:after
ïŒã䜿ã£ãŠæµ®åå°æ°ç¹æ°ãã¯ãªã¢ããŸãã 芪ã«ãªãŒããŒãããŒãèšå®ããã®ã§ã¯ãªããã¯ã©ã¹ clearfix
ãè¿œå ããŸãã 次ã«ããã®CSSãé©çšããŸãïŒ
.clearfix:after {
content: ' ';
visibility: hidden;
display: block;
height: 0;
clear: both;
}
ãããã¯ã芪èŠçŽ ã« overflow: auto
ãŸã㯠overflow: hidden
ããããã£ãäžãããšãåèŠçŽ ã®äžã«æ°ãããããã¯æžåŒèšå®ã³ã³ããã¹ãã確ç«ãããåèŠçŽ ãå«ãããã«å±éãããŸãã
z-index
ãšã¯äœããšãã¹ã¿ãã¯ã³ã³ããã¹ã(ã¹ã¿ãã¯æè)ãã©ã®ããã«äœãããã®ããæããŠãã ããã
CSSã® z-index
ããããã£ã¯ãéãªã£ãŠããèŠçŽ ã®åçŽæ¹åã®ç©ã¿éãé åºãå¶åŸ¡ããŸãã z-index
㯠static
ã§ã¯ãªã position
å€ãæã€èŠçŽ ã«ã®ã¿åœ±é¿ããŸãã
z-index
å€ããªããã°ãèŠçŽ ã¯DOMã«çŸããé çªã§ã¹ã¿ãã¯ãããŸãïŒåãéå±€ã¬ãã«ã®äžäœã®ãã®ãäžçªäžã«è¡šç€ºãããŸãïŒãéçã§ãªãäœçœ®ä»ãã®èŠçŽ ïŒããã³ãããã®åèŠçŽ ïŒã¯ãHTMLéå±€ã«é¢ä¿ãªããåžžã«ããã©ã«ãã®éçé
眮ãæã€èŠçŽ ã®äžã«è¡šç€ºãããŸãã
ã¹ã¿ãã¯ã³ã³ããã¹ã(ã¹ã¿ãã¯æè)ã¯ãäžé£ã®ã¬ã€ã€ãŒãå«ãèŠçŽ ã§ããããŒã«ã«ã¹ã¿ããã³ã°ã³ã³ããã¹ãã§ã¯ããã®åã® z-index
å€ã¯ããã¥ã¡ã³ãã«ãŒãã§ã¯ãªãããã®èŠçŽ ã«çžå¯ŸããŠèšå®ãããŸãããã®ã³ã³ããã¹ãå€ã®ã¬ã€ã€ãŒãã€ãŸãããŒã«ã«ã¹ã¿ããã³ã°ã³ã³ããã¹ãã®å
åŒèŠçŽ ã¯ãã¬ã€ã€ãŒå
ã«ã¬ã€ã€ãŒã眮ãããšã¯ã§ããŸãããèŠçŽ BãèŠçŽ Aã®äžã«åº§ã£ãŠããå ŽåãèŠçŽ Cã®åèŠçŽ ã¯èŠçŽ Bãããé«ããªãããšã¯ãããŸããã
åã¹ã¿ããã³ã°ã³ã³ããã¹ãã¯èªå·±å®çµåã§ããèŠçŽ ã®å
容ãç©ã¿éããããåŸãèŠçŽ å
šäœã芪ã¹ã¿ããã³ã°ã³ã³ããã¹ãã®ç©ã¿éãé ã«èæ
®ãããŸããããã€ãã®CSSããããã£ã¯ã1æªæºã® opacity
ãnone
ã§ã¯ãªã filter
ãnone
ã§ãªã transform
ã®ãããªæ°ããã¹ã¿ããã³ã°ã³ã³ããã¹ããåŒãèµ·ãããŸãã
- https://css-tricks.com/almanac/properties/z/z-index/
- https://philipwalton.com/articles/what-no-one-told-you-about-z-index/
- https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context
ãããã¯æŽåœ¢æèïŒBlock Formatting ContextãBFCïŒãšãã®ä»çµã¿ãæããŠãã ããã
ãããã¯æŽåœ¢æèïŒBlock Formatting ContextãBFCïŒã¯ããããã¯ããã¯ã¹ãé
眮ãããWebããŒãžã®ããžã¥ã¢ã«CSSã¬ã³ããªã³ã°ã®äžéšã§ããæµ®åå°æ°ç¹æ°ã絶察é
眮èŠçŽ ã inline-blocks
ãtable-cells
ãtable-caption
ãvisible
以å€ã® overflow
ãæã€èŠçŽ ïŒãã®å€ããã¥ãŒããŒãã«äŒæãããæãé€ãïŒæžåŒèšå®ã³ã³ããã¹ãããããã¯ããŸãã
BFCã¯ã以äžã®æ¡ä»¶ã®å°ãªããšã1ã€ãæºããHTMLããã¯ã¹ã§ãã
float
ã®å€ã¯none
ã§ã¯ãããŸãããposition
ã®å€ã¯static
ã§ãrelative
ã§ããããŸãããdisplay
ã®å€ã¯table-cell
ãtable-caption
ãinline-block
ãflex
ãinline-flex
ã§ããoverflow
ã®å€ã¯visible
ã§ã¯ãããŸããã
BFCã§ã¯ãåããã¯ã¹ã®å·Šç«¯ãå å«ãããã¯ã®å·Šç«¯ã«æ¥ããŸãïŒå³ããå·Šãžã®æžåŒèšå®ãå³ç«¯ããã®ã¿ããïŒã
BFCã厩å£ãããšãã«é£æ¥ãããããã¯ã¬ãã«ããã¯ã¹éã®åçŽããŒãžã³ã§ãã詳ãã㯠collapsing margins ãèªãã§ãã ããã
- https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context
- https://www.sitepoint.com/understanding-block-formatting-contexts-in-css/
clear ãè¡ãææ³ã«ã¯ã©ã®ãããªãã®ããããããããã©ã®ãããªç¶æ³ã«é©ããŠããŸããïŒ
- 空ã®
div
ã¡ãœãã -<div style="clear:both;"></div>
- Clearfixã¡ãœãã - äžèšã®
.clearfix
ã¯ã©ã¹ãåç §ããŠãã ããã overflow: auto
ãŸãã¯overflow: hidden
ã¡ãœãã - 芪ã¯æ°ãããããã¯æžåŒèšå®ã³ã³ããã¹ãã確ç«ããfloatãããåãå«ãããã«å±éããŸãã
倧èŠæš¡ãªãããžã§ã¯ãã§ã¯ããŠãŒãã£ãªã㣠.clearfix
ã¯ã©ã¹ãäœæããå¿
èŠãªå Žæã§äœ¿çšããŸãã åäŸã芪ãããèãé«ããããã»ã©çæ³çã§ãªãå Žåãoverflow: hidden
ã¯åäŸãã¯ãªãããããããããŸããã
CSSã¹ãã©ã€ããšã¯äœã§ããïŒããŒãžããµã€ãã«å®è£ ããæ¹æ³ãåãããŠèª¬æããŠãã ããã
CSSã¹ãã©ã€ãã¯ãè€æ°ã®ã€ã¡ãŒãžã1ã€ã®å€§ããªã€ã¡ãŒãžã«çµåããŸãã ããã¯äžè¬çã«ã¢ã€ã³ã³çšã®æè¡ã§ãïŒGmailã䜿çšããŠããŸãïŒã ãããå®è£ ããæ¹æ³ïŒ
- ã¹ãã©ã€ããžã§ãã¬ãŒã¿ã䜿çšããŠãè€æ°ã®ç»åã1ã€ã«ãŸãšããé©åãªCSSãçæããŸãã
- ããããã®ã€ã¡ãŒãžã¯ã
background-image
ãbackground-position
ãšbackground-size
ããããã£ãå®çŸ©ãããã察å¿ããCSSã¯ã©ã¹ãæã¡ãŸãã - ãã®ã€ã¡ãŒãžã䜿çšããã«ã¯ã察å¿ããã¯ã©ã¹ãèŠçŽ ã«è¿œå ããŸãã
å©ç¹:
- è€æ°ã®ã€ã¡ãŒãžã«å¯ŸããHTTPãªã¯ãšã¹ãã®æ°ãæžããïŒã¹ãã©ã€ãã·ãŒãããšã«1åã®ãªã¯ãšã¹ãã1åã ãå¿ èŠïŒãããããHTTP2ã§ã¯è€æ°ã®ã€ã¡ãŒãžãèªã¿èŸŒãããšã¯ãã¯ã倧ããªåé¡ã«ã¯ãªããŸããã
- å¿
èŠãªãŸã§ããŠã³ããŒããããªãã¢ã»ããã®äºåããŠã³ããŒããäŸãã°ã
:hover
ç䌌ã¹ããŒãã«ã®ã¿çŸããã€ã¡ãŒãžã ç¹æ» ã¯èŠãããªãã
ãã©ãŠã¶åºæã®ã¹ã¿ã€ãªã³ã°ã«é¢ããåé¡ã解決ããã«ã¯ã©ãããã°ããã§ããïŒ
- åé¡ãç¹å®ããŠåé¡ã®ãã©ãŠã¶ãç¹å®ãããããã®ç¹å®ã®ãã©ãŠã¶ã䜿çšãããŠãããšãã«ã®ã¿ããŒãããå¥ã®ã¹ã¿ã€ã«ã·ãŒãã䜿çšããŸãããã®ææ³ã§ã¯ããµãŒããŒåŽã®ã¬ã³ããªã³ã°ãå¿ èŠã§ãã
- ãããã®ã¹ã¿ã€ãªã³ã°ã®åé¡ãæ¢ã«åŠçããŠããBootstrapã®ãããªã©ã€ãã©ãªã䜿çšããŠãã ããã
- ãã³ããŒãã¬ãã£ãã¯ã¹ãã³ãŒãã«èªåçã«è¿œå ããã«ã¯ã
autoprefixer
ã䜿çšããŸãã - Reset CSSãŸãã¯Normalize.cssã䜿çšããŠãã ããã
æ©èœã®å°ãªããã©ãŠã¶ã«å¯ŸããŠã¯ãã©ã®ããã«ããŒãžãæäŸããŸããïŒã©ã®ãããªãã¯ããã¯/ããã»ã¹ã䜿çšããŸããïŒ
- ã°ã¬ãŒã¹ãã«ã»ãã°ã©ããŒã·ã§ã³ïŒGraceful degradationïŒ - ææ°ã®ãã©ãŠã¶ãŒçšã®ã¢ããªã±ãŒã·ã§ã³ãæ§ç¯ããå€ããã©ãŠã¶ãŒã§ã¯æ©èœãç¶ããããšãä¿èšŒããç¿æ £ã
- ããã°ã¬ãã·ãã»ãšã³ãã³ã¹ïŒProgressive EnhancementïŒ - åºæ¬ã¬ãã«ã®ãŠãŒã¶ãŒãšã¯ã¹ããªãšã³ã¹ã®ããã®ã¢ããªã±ãŒã·ã§ã³ãæ§ç¯ãããããã©ãŠã¶ãŒãããããµããŒããããšãã«æ©èœæ¡åŒµãè¿œå ãããã©ã¯ãã£ã¹ã
- æ©èœã®ãµããŒãã確èªããã«ã¯ãcaniuse.comã䜿çšããŠãã ããã
- èªåãã³ããŒæ¥é èŸæ¿å ¥ã®ããã®*ãªãŒããã¬ãã£ã¯ãµãŒã
- Modernizr ã䜿ã£ãæ©èœã®æ€åº
ã³ã³ãã³ããèŠèŠçã«é ãïŒã¹ã¯ãªãŒã³ãªãŒããŒã®ã¿å©çšå¯èœã«ããïŒæ¹æ³ã«ã¯ã©ã®ãããªãã®ããããŸããïŒããã€ãæããŠãã ããã
ãããã®æè¡ã¯ã¢ã¯ã»ã·ããªãã£ïŒa11yïŒã«é¢é£ããŠããŸãã
visibility: hidden
. ããããèŠçŽ ã¯ãŸã ããŒãžã®æµãã«ããããŸã 空éãå ããŠããŸããwidth: 0; height: 0
. èŠçŽ ãç»é¢äžã®ã¹ããŒã¹ãå šãå ããªãããã«ããŠãããã衚瀺ããªãããã«ããŸããposition: absolute; left: -99999px
. ç»é¢ã®å€åŽã«é 眮ããŸããtext-indent: -9999px
. ããã¯block
èŠçŽ å ã®ããã¹ãã«å¯ŸããŠã®ã¿æ©èœããŸãã- ã¡ã¿ããŒã¿ã ããšãã°ãSchema.orgãRDFãJSON-LDã䜿çšããŸãã
- WAI-ARIAã WebããŒãžã®ã¢ã¯ã»ã·ããªãã£ãåäžãããæ¹æ³ãæå®ããW3Cã®æè¡ä»æ§ã
WAI-ARIAãçæ³çãªè§£æ±ºçã§ãã£ãŠããç§ã¯çµ¶å¯Ÿçãªããžã·ã§ãã³ã°ææ³ãæ¡çšããŠããŸããã»ãšãã©ã®èŠçŽ ã«å¯Ÿå¿ããŠãããããç°¡åãªææ³ã§ãã
- https://www.w3.org/TR/wai-aria-1.1/
- https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA
- http://a11yproject.com/
ã°ãªããã·ã¹ãã ã䜿çšããããšããããŸããïŒäœ¿ã£ãããšããããªããããªãã¯ã©ã®ã°ãªããã·ã¹ãã ã奜ãã§ããïŒ
ç§ã¯ float
ããŒã¹ã®ã°ãªããã·ã¹ãã ã奜ãã§ãããªããªããæ¢åã®ä»£æ¿ã·ã¹ãã ïŒãã¬ãã¯ã¹ãã°ãªããïŒã®äžã§ãæãå€ãã®ãã©ãŠã¶ããµããŒãããŠããããã§ãã ããŒãã¹ãã©ããã§é·å¹Žäœ¿çšãããŠãããåäœããããšã蚌æãããŠããŸãã
ã¡ãã£ã¢ã¯ãšãªãã¢ãã€ã«åºæã®ã¬ã€ã¢ãŠã/CSSã䜿çšãããå®è£ ããããšã¯ãããŸããïŒ
ã¯ãã äžäŸã¯ããã«åããã²ãŒã·ã§ã³ããç¹å®ã®ãã¬ãŒã¯ãã€ã³ããè¶ããåºå®åºã®ã¿ãåããã²ãŒã·ã§ã³ã«å€æããããšã§ããã
ããã...æ²ããããšã«ã
ã¯ãã@media ããããã£ã«ã¯ screen
ãå«ããŠïŒã€ã®çš®é¡ããããŸãã:
all
- for all media type devicesprint
- for printersspeech
- for screenreaders that "reads" the page out loudscreen
- for computer screens, tablets, smart-phones etc.
print
ã¡ãã£ã¢ã¿ã€ãã®äœ¿ãæ¹ã®äŸ:
@media print {
body {
color: black;
}
}
å¹ççãªCSSãæžãã«ããã«é¿ããã¹ã "èœãšãç©Ž" ã«ã¯ã©ããªãã®ããããŸããïŒ
ãŸãããã©ãŠã¶ãã»ã¬ã¯ã¿ãå³ç«¯ïŒããŒã»ã¬ã¯ã¿ïŒããå·Šã«äžèŽãããããšãç解ããŠãã ããããã©ãŠã¶ã¯ããŒã»ã¬ã¯ã¿ã«åŸã£ãŠDOMå ã®èŠçŽ ããã£ã«ã¿ãªã³ã°ãã芪èŠçŽ ãèµ°æ»ããŠäžèŽãå€å®ããŸããã»ã¬ã¯ã¿ãŒãã§ãŒã³ã®é·ããçãã»ã©ããã©ãŠã¶ãŒã¯ãã®ãšã¬ã¡ã³ããã»ã¬ã¯ã¿ãŒãšäžèŽãããã©ãããå€å¥ããããšãã§ããŸãããããã£ãŠãã¿ã°ã»ã¬ã¯ã¿ãšãŠãããŒãµã«ã»ã¬ã¯ã¿ã§ããããŒã»ã¬ã¯ã¿ã¯é¿ããŠãã ããããããã¯å€æ°ã®èŠçŽ ã«ããããããã©ãŠã¶ã¯èŠªãããããããã©ãããå€æããããã«å€ãã®äœæ¥ãããå¿ èŠããããŸãã
BEMïŒBlock Element ModifierïŒã®æ¹æ³è«ã§ã¯ããã¹ãŠãåäžã®ã¯ã©ã¹ãæã¡ãéå±€ãå¿ èŠãªå Žåã¯ã¯ã©ã¹åã«ãçŒãä»ããããããšãæšå¥šãããŠããŸããã»ã¬ã¯ã¿ã¯å¹ççãã€ç°¡åã«ãªãŒããŒã©ã€ãã§ããŸãã
ã©ã®CSSããããã£ããªãããŒãåæç»ãããã³åæãããªã¬ãããã«æ³šæããŠãã ãããå¯èœã§ããã°ãã¬ã€ã¢ãŠãïŒããªã¬ãŒãªãããŒïŒãå€æŽããã¹ã¿ã€ã«ãæžãã®ã¯é¿ããŠãã ããã
ã¡ãªãã:
- CSSã®ã¡ã³ããã³ã¹æ§ãåäžããŸããã
- ãã¹ããããã»ã¬ã¯ã¿ãæžããããã
- äžè²«ããããŒãèšå®ã®ããã®å€æ°ã ç°ãªããããžã§ã¯ãéã§ããŒããã¡ã€ã«ãå ±æã§ããŸãã
- ããã¯ã¹ã€ã³ã¯ç¹°ãè¿ãCSSãçæããŸãã
- ããªãã®ã³ãŒããè€æ°ã®ãã¡ã€ã«ã«åå²ããã CSSãã¡ã€ã«ãåå²ããããšãã§ããŸããããã®ããã«ã¯åCSSãã¡ã€ã«ãããŠã³ããŒãããããã®HTTPãªã¯ãšã¹ããå¿ èŠã§ãã
ãã¡ãªãã:
- ååŠçã®ããã®ããŒã«ãå¿ èŠã§ãã åã³ã³ãã€ã«æéãé ããªãããšããããŸãã
䜿çšããããšã®ããCSSããªããã»ããµã«ã€ããŠå¥œããªãã®ãšå«ããªãã®ãæããŠãã ããã
奜ããªãã®:
- äž»ã«äžèšã®å©ç¹ã
- Lessã¯JavaScriptã§æžãããŠãããNodeã§ããŸããããŸãã
å«ããªãã®:
- Cassã§æžãããLibSassã®ãã€ã³ãã£ã³ã°ã§ãã
node-sass
ã䜿ã£ãŠSassã䜿çšããŸããããŒãã®ããŒãžã§ã³ãåãæ¿ãããšãã«ãé »ç¹ã«åã³ã³ãã€ã«ããå¿ èŠããããŸãã - Lessã§ã¯ãå€æ°åã®å
é ã«
@
ãä»ããŠããŸããããã¯@media
ã@import
ã@font-face
ã«ãŒã«ãªã©ã®ãã€ãã£ãCSSããŒã¯ãŒããšæ··åããããšããããŸãã
font-face
ã䜿ã£ãŠ font-weight
ã® font-family
ãå®çŸ©ããŠãã ããã
CSSã»ã¬ã¯ã¿ã«ãããããèŠçŽ ãã©ããªã®ãããã©ãŠã¶ãã©ã®ããã«æ±ºå®ããŠãããã説æããŠãã ããã
ãã®éšåã¯äžèšã®å¹ççãªCSSã®èšè¿°ã«é¢ãããã®ã§ãããã©ãŠã¶ã¯ã»ã¬ã¯ã¿ãå³ç«¯ïŒããŒã»ã¬ã¯ã¿ïŒããå·Šã«äžèŽãããŸãããã©ãŠã¶ã¯ããŒã»ã¬ã¯ã¿ã«åŸã£ãŠDOMå ã®èŠçŽ ããã£ã«ã¿ãªã³ã°ãã芪èŠçŽ ãèµ°æ»ããŠäžèŽãå€å®ããŸããã»ã¬ã¯ã¿ãã§ãŒã³ã®é·ããçããã°çãã»ã©ããã©ãŠã¶ããã®èŠçŽ ãã»ã¬ã¯ã¿ã«äžèŽãããã©ãããå€æããããšãã§ããŸãã
ããšãã°ããã®ã»ã¬ã¯ã¿ p span
ã§ã¯ããã©ãŠã¶ã¯ãŸããã¹ãŠã® <span>
èŠçŽ ãèŠã€ãããã®èŠªãã«ãŒããŸã§ãã¹ãŠãã©ããŒã¹ã㊠<p>
èŠçŽ ãæ¢ããŸããç¹å®ã® <span>
ã«ã€ããŠã¯ã <p>
ãèŠã€ãããšçŽã¡ã« <span>
ãããããããããã³ã°ãæ¢ããããšãã§ããŸãã
ç䌌èŠçŽ ã«ã€ããŠèª¬æãããããããªãã®ããã«äœ¿ãããŠãããã詳ãã話ããŠãã ããã
CSSç䌌èŠçŽ ã¯ã»ã¬ã¯ã¿ã«è¿œå ãããããŒã¯ãŒãã§ãéžæããèŠçŽ ã®ç¹å®ã®éšåãã¹ã¿ã€ã«ããããšãã§ããŸãã ããŒã¯ã¢ãã(:before
, :after
)ãå€æŽããªããŠããããŒã¯ã¢ãã(combined with content: ...
)ãžã®èŠçŽ ã®è¿œå ããã³ã¬ãŒã·ã§ã³(:first-line
, :first-letter
) ã«äœ¿çšã§ããŸãã
:first-line
ãš:first-letter
ã䜿ã£ãŠããã¹ããè£ é£Ÿããããšãã§ããŸãã- äžèšã®
.clearfix
ããã¯ã§ãclear:both
ã§ãŒãã¹ããŒã¹ã®èŠçŽ ãè¿œå ããããã«äœ¿çšãããŸãã - ããŒã«ãããã®äžè§åœ¢ã®ç¢å°ã¯
:before
ãš:after
ã䜿ããŸããäžè§åœ¢ã¯å®éã«ã¯DOMã§ã¯ãªãã¹ã¿ã€ãªã³ã°ã®äžéšãšã¿ãªããããããæžå¿µã®åé¢ãä¿ããŸãã è¿œå ã®HTMLèŠçŽ ã䜿çšããã«CSSã¹ã¿ã€ã«ã ãã§äžè§åœ¢ãæç»ããããšã¯ãå®éã«ã¯äžå¯èœã§ãã
ããã¯ã¹ã¢ãã«ããªãã§ãããã®ããªãã®ç解ãšãç°ãªãããã¯ã¹ã¢ãã«ã§ã¬ã€ã¢ãŠããã¬ã³ããªã³ã°ããããã«CSSã§ãã©ãŠã¶ã«æ瀺ããæ¹æ³ã説æããŠãã ããã
CSSããã¯ã¹ã¢ãã«ã¯ãããã¥ã¡ã³ãããªãŒå ã®èŠçŽ ã«å¯ŸããŠçæãããèŠèŠçãªæžåŒèšå®ã¢ãã«ã«åŸã£ãŠã¬ã€ã¢ãŠããããé·æ¹åœ¢ã®ããã¯ã¹ãèšè¿°ããŸããåããã¯ã¹ã¯ãå 容é åïŒäŸãã°ãããã¹ããç»åãªã©ïŒããã³ä»»æã®åšå²ã®ãããã£ã³ã°ãããããŒããŒãããã³ãããŒãžã³ãé åãæããã
CSSããã¯ã¹ã¢ãã«ã¯ã次ã®èšç®ãè¡ããŸãã
*ãããã¯èŠçŽ ãã©ããããã®ã¹ããŒã¹ãå ãããã *æ ç·ãäœçœãéãªããã©ããããŸãã¯æãããããã©ããã *ããã¯ã¹ã®å¯žæ³ã
ããã¯ã¹ã¢ãã«ã«ã¯æ¬¡ã®èŠåããããŸãã
- ãããã¯èŠçŽ ã®å€§ããã¯ã
width
ãheight
ãpadding
ãborder
ãããã³margin
ã«ãã£ãŠèšç®ãããŸãã height
ãæå®ãããŠããªãå Žåããããã¯èŠçŽ ã¯å«ãŸããŠããå 容ãšåããããé«ããªããŸãïŒæµ®åå°æ°ç¹æ°ããªãéãã以äžåç §ïŒãwidth
ãæå®ãããŠããªãå Žåãæµ®åå°æ°ç¹ã®ãããã¯èŠçŽ ã¯ããã®èŠªã®å¹ ããpadding
ã®å¹ ã«åãŸãããã«å±éãããŸãã- èŠçŽ ã®
height
ã¯å 容ã®height
ã«ãã£ãŠèšç®ãããŸãã - èŠçŽ ã®
width
ã¯å 容ã®width
ã«ãã£ãŠèšç®ãããŸãã - ããã©ã«ãã§ã¯ã
padding
ãšborder
ã¯èŠçŽ ã®width
ãšheight
ã®äžéšã§ã¯ãããŸããã
- ããã©ã«ãã§ã¯ãèŠçŽ ã«ã¯
box-sizing: content-box
ãé©çšãããã³ã³ãã³ããµã€ãºã®ã¿ãèæ ®ãããŸãã box-sizingïŒborder-box
ã¯ãèŠçŽ ã®width
ãšheight
ãã©ã®ããã«èšç®ãããããå€æŽããborder
ãšpadding
ãèšç®ã«å«ããŸãã- èŠçŽ ã®
height
ã¯ãã³ã³ãã³ãã®height
+åçŽpadding
+ åçŽborder
å¹ ã«ãã£ãŠèšç®ãããŸãã - èŠçŽ ã®
width
ã¯ãã³ã³ãã³ãã®width
+æ°Žå¹³padding
+ æ°Žå¹³border
å¹ ã«ãã£ãŠèšç®ãããŸãã
CSSã® display
ããããã£ãšã¯äœã§ããïŒãã®äœ¿ãæ¹ã®äŸãããã€ãæããããšãã§ããŸããïŒ
none
,block
,inline
,inline-block
,table
,table-row
,table-cell
,list-item
TODO
ç§ã¯è¯ã尺床ã®ããã«block
ãšæ¯èŒããŠæããŸãã
block |
inline-block |
inline |
|
---|---|---|---|
Size | Fills up the width of its parent container. | Depends on content. | Depends on content. |
Positioning | Start on a new line and tolerates no HTML elements next to it (except when you add float ) |
Flows along with other content and allows other elements beside. | Flows along with other content and allows other elements beside. |
Can specify width and height |
Yes | Yes | No. Will ignore if being set. |
Can be aligned with vertical-align |
No | Yes | Yes |
Margins and paddings | All sides respected. | All sides respected. | Only horizontal sides respected. Vertical sides, if specified, do not affect layout. Vertical space it takes up depends on line-height , even though the border and padding appear visually around the content. |
Float | - | - | Becomes like a block element where you can set vertical margins and paddings. |
é
眮ãããèŠçŽ ã¯ãèšç®ããã position
ããããã£ã relative
ãabsolute
ãfixed
ãŸã㯠sticky
ã®ããããã§ããèŠçŽ ã§ãã
static
- ããã©ã«ãã®äœçœ®ã§ããèŠçŽ ã¯éåžžã©ããããŒãžã«æµããŸããtop
ãright
ãbottom
ãleft
ãz-index
ããããã£ã¯é©çšãããŸãããrelative
- èŠçŽ ã®äœçœ®ã¯ãã¬ã€ã¢ãŠããå€æŽããããšãªããããèªäœã«å¯ŸããŠçžå¯Ÿçã«èª¿æŽãããŸãïŒãããã£ãŠãé 眮ãããŠããªãã£ãèŠçŽ ã®ééãæ®ããŸãïŒãabsolute
- èŠçŽ ã¯ãããŒãžã®ãããŒããåé€ãããããããã°ãæãè¿ãäœçœ®ã«ããç¥å ã«å¯ŸããŠæå®ãããäœçœ®ã«çœ®ãããŸãã絶察é 眮ãããããã¯ã¹ã¯äœçœãæã€ããšãã§ããä»ã®äœçœãšäžç·ã«æãç³ãŸããããšã¯ãããŸããããããã®èŠçŽ ã¯ä»ã®èŠçŽ ã®äœçœ®ã«åœ±é¿ããŸãããfixed
- èŠçŽ ã¯ãããŒãžã®ãããŒããåé€ããããã¥ãŒããŒãã«å¯ŸããŠæå®ãããäœçœ®ã«é 眮ãããã¹ã¯ããŒã«ãããšç§»åããŸãããsticky
- ã¹ãã£ãããŒããžã·ã§ãã³ã°ã¯ãçžå¯Ÿäœçœ®ãšåºå®äœçœ®ã®ãã€ããªããã§ããèŠçŽ ã¯ãæå®ããããããå€ãè¶ ãããŸã§ãçžå¯Ÿçãªäœçœ®ãšããŠæ±ãããŸãããã®æç¹ã§ãfixed
ã®äœçœ®ãšããŠæ±ãããŸãã
ããŒã«ã«ãæ¬çªç°å¢ã§ãã©ã®æ¢åã®CSSãã¬ãŒã ã¯ãŒã¯ã䜿çšããŠããŸããïŒãŸããã©ã®ããã«å€æŽ/æ¹åããŠããŸããïŒ
- BootStrap - ç·©ãããªãªãªãŒã¹ãµã€ã¯ã«ãBootStrap4 ã¯ãã»ãŒ2幎éã¢ã«ãã¡ã«ãªã£ãŠããŸãã åºã䜿çšãããŠããããã«ãã¹ãããŒãã¿ã³ã³ã³ããŒãã³ããè¿œå ããŸãã
- Semantic UI - ãœãŒã¹ã³ãŒãæ§é ã«ãããããŒãã®ã«ã¹ã¿ãã€ãºãéåžžã«é£ãããªããŸããæ £ç¿çã§ãªãããŒãèšå®ã·ã¹ãã ã§ã«ã¹ã¿ãã€ãºããã®ã¯é¢åã§ãã ãã³ãã©ã€ãã©ãªå ã®ããŒãã³ãŒããããèšå®ãã¹ãBootStrap ãšã¯éã£ãŠãå€æ°ããªãŒããŒã©ã€ãããããã«ããŸãèšèšãããŠããŸããã
- Bulma - éã»ãã³ãã£ãã¯ã§äœèšãªã¯ã©ã¹ãããŒã¯ã¢ãããå¿ èŠã§ããäžäœäºææ§ããããŸãããããŒãžã§ã³ãã¢ããã°ã¬ãŒããããšã埮åŠãªæ¹æ³ã§ã¢ããªãå£ããŠããŸããŸãã
ã¯ãã Flexbox ã¯äž»ã«1次å ã¬ã€ã¢ãŠããæå³ããGrid ã¯2次å ã¬ã€ã¢ãŠããæå³ããŸãã
Flexboxã¯ãã³ã³ããå
ã®èŠçŽ ã®åçŽæ¹åã®ã»ã³ã¿ãªã³ã°ãã¹ãã£ãããŒããã¿ãŒãªã©ãCSSã®å€ãã®äžè¬çãªåé¡ã解決ããŸããããŒãã¹ãã©ãããšBulmaã¯FlexboxãããŒã¹ã«ããŠããŸããFlexboxãè©ŠããŠã¿ãŸããããflex-grow
ã䜿ã£ãŠããã€ãã®ãã©ãŠã¶ã®éäºææ§åé¡ïŒSafariïŒã«ééããŸããããã㊠inline-blocks
ãš % ã§å¹
ãèšç®ããã³ãŒããæžãçŽããªããã°ãªããŸããã§ããã
ã°ãªããã¯ãã°ãªããããŒã¹ã®ã¬ã€ã¢ãŠããäœæããããã®æãçŽèŠ³çãªã¢ãããŒãã§ãïŒããè¯ãïŒïŒãããã©ãŠã¶ã®ãµããŒãã¯çŸæç¹ã§ã¯åºç¯ã§ã¯ãããŸããã
ãŠã§ããµã€ããã¬ã¹ãã³ã·ãã§ã³ãŒãã£ã³ã°ããããšãšã¢ãã€ã«ãã¡ãŒã¹ãã§ã³ãŒãã£ã³ã°ããããšã®éãã説æã§ããŸããïŒ
TODO
å¿çæ§ãšé©å¿æ§ã®äž¡æ¹ã®èšèšã§ã¯ãããŸããŸãªããã€ã¹éã§ãŠãŒã¶ãŒãšã¯ã¹ããªãšã³ã¹ãæé©åããç°ãªããã¥ãŒããŒããµã€ãºã解å床ã䜿çšç¶æ³ãå¶åŸ¡ã¡ã«ããºã ãªã©ã調æŽããŸãã
ã¬ã¹ãã³ã·ããªãã¶ã€ã³ã¯ãæè»æ§ã®åå - ãã¹ãŠã®ããã€ã¹ã§èŠãç®ããããªãåäžã®æµäœãŠã§ããµã€ã - ã§åäœããŸããã¬ã¹ãã³ã·ããªãŠã§ããµã€ãã¯ãã¡ãã£ã¢ã¯ãšãªããã¬ãã·ãã«ã°ãªãããããã³åå¿æ§ã®é«ãã€ã¡ãŒãžã䜿çšããŠãå€æ°ã®èŠå ã«åºã¥ããŠæè»ã«å€åãããŠãŒã¶ãŒãšã¯ã¹ããªãšã³ã¹ãäœãåºããŸãã 1ã€ã®ããŒã«ãæé·ããããåçž®ããŠè€æ°ã®ç°ãªãããŒãã«åãŸãããã«ããŸãã
ã¢ãããã£ãã»ãã¶ã€ã³ã¯ãããã°ã¬ãã·ãã»ãšã³ãã³ã¹ã¡ã³ãã®çŸä»£çå®çŸ©ã«ãã£ãšäŒŒãŠããŸãæè»ãªãã¶ã€ã³ã§ã¯ãªããããã€ã¹ããã®ä»ã®æ©èœãæ€åºãããããããå®çŸ©ãããäžé£ã®ãã¥ãŒããŒããµã€ãºããã®ä»ã®ç¹æ§ã«åºã¥ããŠé©åãªæ©èœãšã¬ã€ã¢ãŠããæäŸããŸãããµã€ãã¯äœ¿çšãããŠããããã€ã¹ã®ã¿ã€ããæ€åºãããã®ããã€ã¹ã®ããªã»ããã¬ã€ã¢ãŠããé ä¿¡ããŸãã 1ã€ã®ããŒã«ãããã€ãã®ç°ãªããµã€ãºã®ããŒããééãã代ããã«ãããŒããµã€ãºã«å¿ããŠããã€ãã®ç°ãªãããŒã«ã䜿çšã§ããŸãã
- https://developer.mozilla.org/en-US/docs/Archive/Apps/Design/UI_layout_basics/Responsive_design_versus_adaptive_design
- http://mediumwell.com/responsive-adaptive-mobile/
- https://css-tricks.com/the-difference-between-responsive-and-adaptive-design/
Retina 察å¿ãè¡ã£ãããšã¯ãããŸããïŒãããããªãããã€ã©ã®ãããªãã¯ããã¯ã䜿ããŸãããïŒ
ç§ã¯ Retina ãã£ã¹ãã¬ã€ãæ±ãããã«é«è§£å床ã®ã°ã©ãã£ãã¯ã¹ïŒãã£ã¹ãã¬ã€ãµã€ãºã®2åïŒã䜿çšããåŸåããããŸãã ããè¯ãæ¹æ³ã¯ @media only screenãšïŒmin-device-pixel-ratio: 2ïŒ{...}
ã®ãããªã¡ãã£ã¢ã¯ãšãªã䜿çšãã background-image
ãå€æŽããããšã§ãã
ã¢ã€ã³ã³ã«ã€ããŠã¯ã解å床ã«é¢ä¿ãªãéåžžã«é®®æã«è¡šç€ºããããããå¯èœã§ããã°svgsãšã¢ã€ã³ã³ãã©ã³ãã䜿çšããããšãéžæããŸãã
ããäžã€ã®æ¹æ³ã¯JavaScriptã䜿ã£ãŠã<img>
src
å±æ§ã window.devicePixelRatio
å€ããã§ãã¯ããåŸãããé«è§£å床ã®ããŒãžã§ã³ã«çœ®ãæããããšã§ãã
position: absolute
ã®ä»£ããã« translate()
ã䜿çšããã¹ãå Žåã¯ãããŸããïŒãã®éã®å ŽåããããŸããïŒçç±ãåãããŠæããŠãã ããã
translate()
ã¯CSSã® transform
ã®å€ã§ããtransform
ã opacity
ãå€æŽããŠãããã©ãŠã¶ã®ãªãããŒãåæç»ã¯è¡ããããã³ã³ããžã·ã§ã³ã®ã¿ãããªã¬ãããŸãã transform
ã¯ãã©ãŠã¶ã«èŠçŽ ã®GPUå±€ãäœæãããŸããã絶察é
眮ããããã£ãå€æŽãããšCPUã䜿çšããŸãã ãããã£ãŠãtranslate()
ã¯ããå¹ççã§ãããããæ»ãããªã¢ãã¡ãŒã·ã§ã³ã®ããã®ãã€ã³ãæéãççž®ããŸãã
translate()
ã䜿çšãããšãèŠçŽ ã¯çµ¶å¯Ÿäœçœ®ãå€æŽããã®ãšã¯ç°ãªããå
ã®ã¹ããŒã¹ã䜿ããŸãïŒposition: relative
ã®ãããªãã®ïŒã