tao1874
tao1874
第1题 ```js const diag = document.createElement('dialog') document.body.appendChild(diag) ``` 第2题 ```js diag.open = 'xxxx' ``` 第3题 ```js const btn = document.createElement('button') btn.innerText='关闭' btn.addEventListener('click',function(){ this.parentNode.open = false //发现正确的方式应该是调用close(),这样做遮罩会去不掉 }) diag.appendChild(btn) ``` 第4题...
```css .box { padding: 0 1em; display: grid; grid-auto-flow: column; grid-gap: 1em; } .btn { border: 1px solid #ef777e; border-radius: 1em; text-align: center; line-height: 2em; color: #ee715c; } ``` [DEMO](https://codepen.io/tao1874/pen/OezjvP)...
[Demo](https://codepen.io/tao1874/pen/KKKmmdV) ```css * { box-sizing: border-box; } ul { display: flex; font-size: 12px; } li { list-style: none; margin: 0 5px; display: flex; } a { display: flex; padding: 3px...
[demo](https://codepen.io/tao1874/pen/qBWQyoN) ```css .content { position: relative; text-decoration: none; color: white; } .tag { vertical-align: top; line-height: 1.5; padding: 0 .2em; background: #cd0000; position: absolute; } .img { display: inline-block; width:...
```js //zxx: 3,4测试部通过,还有缩进扣分 //1. function toCamelCase(str) { return str.replace(/-\w/g, function ([dash, word]) { return word.toUpperCase(); }); } console.log(toCamelCase("abc-def-ghi")); //2. function toDashJoin(str) { return str.replace(/[A-Z]/g, function (match) { return `-${match.toLowerCase()}`; });...
```html 登录 | 忘记密码? 立即注册 ```
```css html,body { height: 100%; margin: 0; } .container{ height: 100%; display: grid; grid-template-rows: 1fr auto; } .footer { background-color: red; } ``` [Demo](https://codepen.io/tao1874/pen/YoKgaZ) ```js //zxx: grid用得不错,可惜重置了body高度,扣1分 ```
###### 第一题 ```js content.length > 140 ```` ###### 第二题和第三题 ```js let newContent = content.trim().replace(/\s+/g," ") newContent.length > 140//第二题 let unicodeStrs =[] let asciiStrs = [] for (const i of newContent)...