Skip to content

Commit 9e9c852

Browse files
committed
DOM
1 parent 7e63898 commit 9e9c852

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/1-trial-session/13-dom/index.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,17 @@ element.style.backgroundColor = "red";
5555

5656
[CSS の節](../12-css/index.md)の課題を、<Term type="styleAttribute">style 属性</Term>を使用せずに JavaScript のみで実現してみましょう。
5757

58+
<Answer type="JSを用いたCSSスタイリング">
59+
60+
```javascript
61+
const element = document.getElementById("foo");
62+
element.style.border = "1px solid #aaa";
63+
element.style.borderRadius = "10px";
64+
element.style.margin = "30px";
65+
element.style.padding = "30px";
66+
element.style.boxShadow = "0px 0px 2px 1px #aaa";
67+
```
68+
5869
<ViewSource url={import.meta.url} path="_samples/css" />
70+
71+
</Answer>

0 commit comments

Comments
 (0)