diff options
author | Clement Ho <ClemMakesApps@gmail.com> | 2018-03-07 15:56:19 -0600 |
---|---|---|
committer | Clement Ho <ClemMakesApps@gmail.com> | 2018-03-07 15:56:19 -0600 |
commit | eebfdcf3694b7f4e07d1946195db0354c1483972 (patch) | |
tree | ff4dd90465ff71bf1df35760c6a6a10e4ff96c0b | |
parent | 7ab48d3b75a601e4a478ae3134668c5e07b4eecf (diff) | |
download | gitlab-ce-eebfdcf3694b7f4e07d1946195db0354c1483972.tar.gz |
Improve html docs
-rw-r--r-- | doc/development/new_fe_guide/style/html.md | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/doc/development/new_fe_guide/style/html.md b/doc/development/new_fe_guide/style/html.md index bdd66da760b..122e02c2463 100644 --- a/doc/development/new_fe_guide/style/html.md +++ b/doc/development/new_fe_guide/style/html.md @@ -3,7 +3,7 @@ ## Buttons <a name="button-type"></a><a name="1.1"></a> -- [1.1](#button-type) **Use button type** Button type is a required attribute for button tags according to the HTML specification. +- [1.1](#button-type) **Use button type** Button tags requires a `type` attribute according to the [W3C HTML specification](button-type-spec). ``` // bad @@ -16,8 +16,7 @@ ## Links <a name="blank-links"></a><a name="2.1"></a> -- [2.1](#blank-links) **Use rel for target blank** Use `rel="noopener noreferrer"` whenever your links `target="_blank"`. -This prevents a security vulnerability documented by [JitBit][JitBit] +- [2.1](#blank-links) **Use rel for target blank** Use `rel="noopener noreferrer"` whenever your links open in a new window i.e. `target="_blank"`. This prevents [the following][jitbit-target-blank] security vulnerability documented by JitBit ``` // bad @@ -28,7 +27,7 @@ This prevents a security vulnerability documented by [JitBit][JitBit] ``` <a name="fake-links"></a><a name="2.2"></a> -- [2.2](#fake-links) **Avoid using fake links** Buttons should be used if a link only invokes JavaScript click event handlers. +- [2.2](#fake-links) **Avoid using fake links** Use a button tag if a link only invokes JavaScript click event handlers. This is more semantic. ``` // bad @@ -38,4 +37,5 @@ This prevents a security vulnerability documented by [JitBit][JitBit] <button class="js-do-something" type="button"></button> ``` -[JitBit]: https://www.jitbit.com/alexblog/256-targetblank---the-most-underestimated-vulnerability-ever/ +[button-type-spec]: https://www.w3.org/TR/2011/WD-html5-20110525/the-button-element.html#dom-button-type +[jitbit-target-blank]: https://www.jitbit.com/alexblog/256-targetblank---the-most-underestimated-vulnerability-ever/ |