Skip to content

Commit

Permalink
fix(SVG): Minor rewrite of example to avoid line wrapping (#28498)
Browse files Browse the repository at this point in the history
  • Loading branch information
bsmth authored Aug 14, 2023
1 parent 8578969 commit c96ce9d
Showing 1 changed file with 11 additions and 18 deletions.
29 changes: 11 additions & 18 deletions files/en-us/web/svg/attribute/stroke-dasharray/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,35 +37,28 @@ svg {

```html
<svg viewBox="0 0 30 12" xmlns="http://www.w3.org/2000/svg">
<style>
line {
stroke: black;
}
</style>
<!-- No dashes nor gaps -->
<line x1="0" y1="1" x2="30" y2="1" stroke="black" />
<line x1="0" y1="1" x2="30" y2="1" />

<!-- Dashes and gaps of the same size -->
<line x1="0" y1="3" x2="30" y2="3" stroke="black" stroke-dasharray="4" />
<line x1="0" y1="3" x2="30" y2="3" stroke-dasharray="4" />

<!-- Dashes and gaps of different sizes -->
<line x1="0" y1="5" x2="30" y2="5" stroke="black" stroke-dasharray="4 1" />
<line x1="0" y1="5" x2="30" y2="5" stroke-dasharray="4 1" />

<!-- Dashes and gaps of various sizes with an odd number of values -->
<line x1="0" y1="7" x2="30" y2="7" stroke="black" stroke-dasharray="4 1 2" />
<line x1="0" y1="7" x2="30" y2="7" stroke-dasharray="4 1 2" />

<!-- Dashes and gaps of various sizes with an even number of values -->
<line
x1="0"
y1="9"
x2="30"
y2="9"
stroke="black"
stroke-dasharray="4 1 2 3" />
<line x1="0" y1="9" x2="30" y2="9" stroke-dasharray="4 1 2 3" />

<!-- Dashes starting with a gap -->
<line
x1="0"
y1="11"
x2="30"
y2="11"
stroke="black"
stroke-dasharray="0 4 0" />
<line x1="0" y1="11" x2="30" y2="11" stroke-dasharray="0 4 0" />
</svg>
```

Expand Down

0 comments on commit c96ce9d

Please sign in to comment.