ðCSSã®åºæ¬â¡ð
ðïŒã€ã®ã»ã¬ã¯ã¿ãŒã䜿ããããã«ãªãã
ã»ã¬ã¯ã¿ãŒãšã¯ïŒã©ãã®ïŒ{
ããããã£ïŒäœãïŒïŒå€ïŒã©ãããïŒïŒ
}
ð±ïŒã€ã®ã»ã¬ã¯ã¿ãŒ
- ãšã¬ã¡ã³ãïŒèŠçŽ ïŒã»ã¬ã¯ã¿ãŒ
- idã»ã¬ã¯ã¿ãŒ
- ã¯ã©ã¹ã»ã¬ã¯ã¿ãŒ
1. ãšã¬ã¡ã³ãïŒèŠçŽ ïŒã»ã¬ã¯ã¿ãŒ
èŠçŽ ãæå®ããŠã¹ã¿ã€ã«ãèšå®ããæ¹æ³
body {
background-color: #ccc;
}
2. IDã»ã¬ã¯ã¿ãŒ
èŠçŽ ã«ããŒãžå
ã§ãŠããŒã¯ãªååã§ããidãã€ãããã
ãã®idãæå®ããŠã¹ã¿ã€ã«ãä»ããããïŒ
<p id="hello">ããã«ã¡ã¯äžæãã</p>
CSSã§ã¯
#hello {
color: blue;
}
â ïžåãããŒãžå ã§äžç®æããæå®ã§ããªã!!
3. ã¯ã©ã¹ã»ã¬ã¯ã¿ãŒ
ã»ã¬ã¯ã¿ãŒã«ã¯ã©ã¹ãæå®ãã
ã¯ã©ã¹ãšããã®ã¯HTMLã®å±æ§ã«å¯ŸããŠã¯ã©ã¹åãä»ããããšã§ã°ã«ãŒãåããã§ããæ©èœ
idãšéãHTMLå
ã§åãååã§äœåèšå®ããŠãOKðð»ââïž
åãå
容ã®ã¹ã¿ã€ã«ãè€æ°ã®èŠçŽ ã«èšå®ãããå Žåã«äŸ¿å©ïŒïŒ
<ul>
<li><input type="checkbox">èªæž</li>
<li class="completed"><input type="checkbox" checked>HTMLã®åŠç¿</li>
<li class="completed"><input type="checkbox" checked>JavaScriptã®åŠç¿</li>
</ul>
CSS
.completed {
text-decoration: line-through;
}
ðã¯ã©ã¹ãæå®ããã«ã¯ããããã€ããïŒ
<li class="completed red"><input type="checkbox" checked>JavaScriptã®åŠç¿</li>
äžã€ã®èŠçŽ ã«å¯ŸããŠè€æ°ã®ã¯ã©ã¹ãæå®ããããšãã§ããïŒïŒð
ðçµååã䜿ã£ãã»ã¬ã¯ã¿ãæå®
ãã詳现ã«ã»ã¬ã¯ã¿ã®é©çšå ãæå®ããããšãã§ããïŒ
ð±çµååã䜿ã£ãã»ã¬ã¯ã¿ã®çš®é¡
- ãŠãããŒãµã«ã»ã¬ã¯ã¿ *ãå šãŠã®èŠçŽ ã«é©çšãâ²
- åå«ã»ã¬ã¯ã¿ ã¹ããŒã¹ãAã®éå±€äžã®å šãŠã®Bãâ
- åã»ã¬ã¯ã¿ >ãAã®äžã€äžã®éå±€ã®Bãâ
- é£æ¥ã»ã¬ã¯ã¿ + Aã®çŽåŸã«èšè¿°ããåãéå±€ã®Bãâ²
- éæ¥ã»ã¬ã¯ã¿ ~ãAã®åŸã«èšè¿°ããå šãŠã®åéå±€ã®Bãâ²
1. ãŠãããŒãµã«ã»ã¬ã¯ã¿
å
šãŠã®èŠçŽ ãšããã®ã¯HTMLèŠçŽ BODYèŠçŽ ãããã«ãã®é
äžã«é
眮ããèŠçŽ å
šãŠã«é©çšããã
ãã©ãŠã¶ãããã©ã«ãã§æã£ãŠããã¹ã¿ã€ã«ãæ¶ãããæã«å©çšïŒ
* {
margin: 0;
}
2. åå«ã»ã¬ã¯ã¿
PèŠçŽ ã®éå±€åã®å šãŠã®ã¹ããã³ã°èŠçŽ ã«ã¹ã¿ã€ã«ãé©çšããã
p strong {
color: red;
}
3. åã»ã¬ã¯ã¿
PèŠçŽ ã®äžã€äžã®éå±€ã®ã¹ããã³ã°èŠçŽ ã«ã¹ã¿ã€ã«ãé©çš
p>strong {
color: red;
}
4. é£æ¥ã»ã¬ã¯ã¿
HèŠçŽ ã®çŽåŸã«èšè¿°ããåãéå±€ã®PèŠçŽ ã«ã¹ã¿ã€ã«ãé©çšããã
h2+p {
color: red;
}
5. éæ¥ã»ã¬ã¯ã¿
H1èŠçŽ ã®åŸã«èšè¿°ããå šãŠã®åéå±€ã®PèŠçŽ ã«ã¹ã¿ã€ã«ãé©çš
h1~p {
color: red;
}
ðè€æ°ã®ã»ã¬ã¯ã¿ãæå®
ã«ã³ãåºåãã§è€æ°ã®ã»ã¬ã¯ã¿ãæžãããšãã§ããïŒ
å¥ã®èšãæ¹ã§ã»ã¬ã¯ã¿ãªã¹ãã䜿ããšãã
h1,
p {
color: blue;
}
ã»ã¬ã¯ã¿ãªã¹ãã䜿ããšäžã€ãã€èšèŒããå Žåãšæ¯ã¹ãŠ
CSSãèŠããããªãïŒðð»ââïž
ðãªã³ã¯ã§äœ¿çšããæ¬äŒŒã¯ã©ã¹ãèšå®
æ¬äŒŒã¯ã©ã¹ãšã¯~
èŠçŽ ã®ç¶æ
ã«å¿ããŠCSSã®èšå®ãé©çšããããšãã§ãã
ð±äž»ãªãªã³ã¯ã§äœ¿çšããæ¬äŒŒã¯ã©ã¹
- a:linkãæªèšªåã®ãªã³ã¯
- a:visitedã蚪åãã¿ã®ãªã³ã¯
- a:hoverããããŒç¶æ ã®ãªã³ã¯
- a:activeãã¯ãªãã¯ç¶æ ã®ãªã³ã¯
a:link {
color: black;
}
a:visited {
color: red;
}
a:hover {
color: green;
}
a:active {
color: blue;
}
â ïž
link,visted,hover,activeã®é çªã§èšè¿°ãã
Ï(
é çªãå®ããªããšæåŸ
ããåäœã«ãªããªãïŒïŒ
LVHAãšèŠãã
ã¹ãããã¿ãã¬ãããªã©ã§ã¯ãããŒç¶æ ãçºçããªã
ðãã©ã³ããæå®ããã
CSSã«ãããã©ã³ãæå®
æ§æ
ãã©ã³ãåãšãã©ã³ããã¡ããªãŒ
ã©ããã£ãŠæå®ã決ããã®ã
æ§æ
ã»ã¬ã¯ã¿{
Font-family: ãã©ã³ãåORãã©ã³ããã¡ããªãŒ;
}
äŸïŒ
html {
font-family: self;
}
ð±ãã©ã³ãå
å ·äœçãªãã©ã³ãåãæå®
äŸïŒ
- ã¡ã€ãªãª
- Hiragino Kaku Gothic ProN
ã·ã¹ãã ã«ã€ã³ã¹ããŒã«ãããŠãããã©ã³ããããã€ã¹ã«ãã£ãŠç°ãªãã®ã§
ãšã³ãžãã¢ããã¶ã€ããŒãæå³ããªããã©ã³ãã衚瀺ãããå¯èœæ§ããã課é¡ããã
Macã ãšãã©ã³ãããã¯ã§ç¢ºèªã§ãã
ð±ãã©ã³ããã¡ããªãŒ
ãã©ã³ãã®çš®é¡ã瀺ãããŒã¯ãŒãã§æå®
- Serifðææäœ
- Sans-serifðãŽã·ãã¯äœ
font-falilyããããã£ã®èšå®äºäŸ
html {
font-falily: âã¡ã€ãªãªâ,âHiragino Kaku Gothic ProNâ, sans-serif;
}
Ï(
è€æ°ã®ãã©ã³ãåããã©ã³ããã¡ããªãŒãã«ã³ãåºåãã§æå®ã§ãã
å·ŠåŽã®æå®ããåªå
ããŠäœ¿ãããïŒïŒ
ãã©ã³ãåã¯ââã§å²ããããã©ã³ããã¡ããªãŒã¯å²ããªã
æå®ã«ã€ããŠã¯çµ¶å¯Ÿçãªæ£è§£ã¯ãªãã
æ¥æ¬ã®ãµã€ãã§ã¯ã·ã³ãã«ã«æå®ãããšã
WindowsåããMacåããINAXãªã©ã§èŠãããå Žåãæ³å®ããŠ
ãã©ã³ããã¡ããªãŒã®æå®ãããæ¹æ³ãèããããïŒ
ð€ð€ð€
ã©ããã£ãŠæå®ã決ããïŒïŒ
ãã©ã³ããã¡ããªãŒã®èšå®æ¹æ³ã«ã¯ãäžã€ã®æ£è§£ãããããã§ã¯ãªã
ãããžã§ã¯ãã§æ±ºããã倧æã®ãŠã§ããµã€ããç 究ãããªã©ïŒ
ð
ãŠã§ããµã€ããæ€èšŒã®ãšã¬ã¡ã³ãã¿ãã§HTMLãã¯ãªãã¯ããŠãã©ã³ããã¡ããªãŒã®æå®ã確èªïŒ
ðãŠã§ããã©ã³ããå©çšããã
ãŠã§ããã©ã³ããšã¯ã
WEBãµãŒããŒäžã«é
眮ãããã©ã³ããã¡ã€ã«ãã€ã³ã¿ãŒãããçµç±ã§é
ä¿¡ããŠ
ãŠã§ããã©ãŠã¶ã§è¡šç€ºãããä»çµã¿
ãŠã§ããã©ã³ããå©çšããã¡ãªãã
ã©ã®ãŠãŒã¶ãŒç°å¢ã§ããåäžã®ãã©ã³ãã衚瀺ãããããã«ãªãïŒïŒ
補äœè
ã®æãéãã®å°è±¡ããŠãŒã¶ãŒã«äžããããšãã§ããïŒ
ð¡Googleãã©ã³ããå©çš
ãªã³ã¯ãšãã©ã³ããã¡ããªãŒãã³ãããã_Ï(_
ðââïžã¡ãªãã
- ã·ã¹ãã ã«äŸåããªãã§ãæå³ãããã©ã³ãããŠãŒã¶ãŒã«è¡šç€ºã§ãã
ð ãã¡ãªãã
- ããŠã³ããŒãã«æéãããããããŒãžã®è¡šç€ºãé ãæããããå Žåããã
- ææã®å Žåããã
ðããã¹ãã«ããŸããŸãªã¹ã¿ã€ã«ãåœãŠãæ¹æ³
å©çšé »åºŠãé«ããã®
h1 {
color: blue;
font-size: 64px;
/* text-align: right; */
/* text-align: left; */
text-align: center;
}
p {
font-weight: bold;
/* text-decoration: line-through; */
text-decoration: underline;
}
ä»æ¥ã¯CSSã®åºæ¬ç¿åŸç·šã®æ®ããçµããããïŒ
ç䌌ããªãããã¡ã¢ããªããã ãšãã£ã±ãæéãããã
ã§ãæ°ããMacãå±ãããã¢ããäžãã£ãïŒïŒ
ç©ã¿éããç¿æ
£åã倧äºðªð»ãã¯ãŒ
Discussion