Skip to content

Commit

Permalink
改善类型属性的翻译
Browse files Browse the repository at this point in the history
  • Loading branch information
PoBlue authored Sep 18, 2017
1 parent 8619d5a commit 786daa0
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions 前端工程师纳米学位样式指南 - HTML .md
Original file line number Diff line number Diff line change
Expand Up @@ -182,31 +182,23 @@
```

### 类型属性
忽略样式表和脚本的类型属性
忽略样式表和脚本的 type 属性

不要针对样式表和脚本使用类型属性。由于 HTML 意味着文本 `/css` 和文本 `/javascript` 为默认设置,在此类语境中无需设置类型属性。在老式浏览器中,也可以安全进行此项操作
不要针对样式表和脚本使用 type 属性。因为 HTML 已经默认设置了 `text/css` `text/javascript` ,所以在此类语境中无需设置 type 属性

**不推荐:**

```html
<link rel="stylesheet" type="text/css" href="css/style.css">
```

**推荐:**

```html
<link rel="stylesheet" href="css/style.css">
```
在老式浏览器中,也可以安全进行此项操作。

**不推荐:**

```html
```
<link rel="stylesheet" type="text/css" href="css/style.css">
<script src="js/app.js" type="text/javascript"></script>
```

**推荐:**

```html
```
<link rel="stylesheet" href="css/style.css">
<script src="js/app.js"></script>
```

Expand Down

0 comments on commit 786daa0

Please sign in to comment.