shape
Experimental: ããã¯å®é¨çãªæ©è½ã§ãã
æ¬çªã§ä½¿ç¨ããåã«ãã©ã¦ã¶ã¼äºææ§ä¸è¦§è¡¨ããã§ãã¯ãã¦ãã ããã
shape 㯠CSS ã®ã¡ãã£ã¢ç¹æ§ã§ã端æ«ã®å½¢ç¶ãç©å½¢ã§ããã丸ããã£ã¹ãã¬ã¤ã§ããããåºå¥ããããã«ä½¿ç¨ãããã¨ãã§ãã¾ãã
æ§æ
shape ã¯è奿©è½ã§ãããåä»å¯è½ãª 2 ã¤ã®æååã®ãã¡ã®ã©ã¡ããæå®ãã¾ããrect ã¯åè§ãç»é¢ã表ããround ã¯åå½¢ãæ¥åå½¢ã®ç»é¢ã表ãã¾ãã
ä¾
>åºæ¬çãªä¾
HTML
html
<h1>Hello World!</h1>
CSS
css
h1 {
text-align: left;
}
@media (shape: rect) {
h1 {
text-align: left;
}
}
@media (shape: round) {
h1 {
text-align: center;
}
}
ã«ã¹ã¿ã ã¹ã¿ã¤ã«ã·ã¼ã
ãã® HTML ã¯ã丸ãç»é¢ãæã¤ç«¯æ«ã«ç¹æ®ãªã¹ã¿ã¤ã«ã·ã¼ããé©ç¨ãã¾ãã
html
<head>
<link rel="stylesheet" href="default.css" />
<link
media="screen and (shape: rect)"
rel="stylesheet"
href="rectangle.css" />
<link media="screen and (shape: round)" rel="stylesheet" href="round.css" />
</head>
仿§æ¸
| Specification |
|---|
| CSS Round Display Level 1> # shape-media-feature> |
ãã©ã¦ã¶ã¼ã®äºææ§
ä»ã®ã¨ããããã®æ©è½ã«å¯¾å¿ãã¦ãããã©ã¦ã¶ã¼ã¯ããã¾ããã
é¢é£æ å ±
- ã¡ãã£ã¢ã¯ã¨ãªã¼ã®ä½¿ç¨
- @media
- CSS åå½¢ãã£ã¹ãã¬ã¤ã¢ã¸ã¥ã¼ã«
- ç°å¢å¤æ°ã®ä½¿ç¨
- CSS ç°å¢å¤æ°ã¢ã¸ã¥ã¼ã«