mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Update HTML style guide with rule about putting nested elements on multiple lines. (#12812)
This commit is contained in:
parent
30ba98c6b6
commit
e3af175b77
1 changed files with 22 additions and 0 deletions
|
@ -61,6 +61,28 @@ If the element doesn't have children, add the closing tag on the same line as th
|
|||
></div>
|
||||
```
|
||||
|
||||
## Nested elements belong on multiple lines
|
||||
|
||||
Putting nested elements on multiple lines makes it easy to scan and identify tags, attributes, and text
|
||||
nodes, and to distinguish elements from one another. This is especially useful if there are multiple
|
||||
similar elements which appear sequentially in the markup.
|
||||
|
||||
### Do
|
||||
|
||||
```html
|
||||
<div>
|
||||
<span>
|
||||
hi
|
||||
</span>
|
||||
</div>
|
||||
```
|
||||
|
||||
### Don't
|
||||
|
||||
```html
|
||||
<div><span>hi</span></div>
|
||||
```
|
||||
|
||||
## Accessibility
|
||||
|
||||
### Don't use the `title` attribute
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue