Skip to content

Commit 2ffe7a9

Browse files
NdpntMattiSG
andcommitted
Improve example
Co-authored-by: Matti Schneider <[email protected]>
1 parent fb9225f commit 2ffe7a9

File tree

1 file changed

+20
-40
lines changed

1 file changed

+20
-40
lines changed

content/terms/explanations/range-selectors.md

Lines changed: 20 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -23,63 +23,43 @@ Let's take an example to see when range selectors can be useful. Given the follo
2323
<body>
2424
<main>
2525
<!-- Breadcrumb Navigation -->
26-
<div>
27-
<ol>
28-
<li><a href="/">Home</a></li>
29-
<li><a href="/legal">Legal</a></li>
30-
<li>Terms and Conditions</li>
31-
</ol>
32-
</div>
33-
34-
<!-- Sub Navigation -->
35-
<div>
36-
<nav>
37-
<ul>
38-
<li>
39-
<a href="/legal/terms">Terms and Conditions</a>
40-
</li>
41-
<li>
42-
<a href="/legal/privacy">Privacy Policy</a>
43-
</li>
44-
</ul>
45-
</nav>
46-
</div>
26+
<ul>
27+
<li><a href="/">Home</a></li>
28+
<li>Terms and Conditions</li>
29+
</ul>
4730

4831
<!-- Main Content -->
49-
<h1><a id="terms-title" href="#terms-title">Example Terms</a></h1>
32+
<h1 id="terms-title">Example Terms</h1>
5033
<p>Effective as of: January 1, 2024</p>
5134

52-
<h2><a id="section-1" href="#section-1">1. Introduction</a></h2>
53-
<p>These are example terms and conditions.</p>
35+
<h2>Authorized uses</h2>
36+
<p>You can use this service in the following cases:</p>
5437

55-
<h2><a id="section-2" href="#section-2">2. Usage</a></h2>
56-
<p>Sample usage guidelines go here.</p>
38+
<ul>
39+
<li>At home</li>
40+
<li>In your office</li>
41+
<li>In a coffee shop</li>
42+
</ul>
5743
</main>
58-
59-
60-
<footer id="page-footer">
61-
<nav>
62-
<div>
63-
<ul>
64-
<li><a href="/about">About</a></li>
65-
<li><a href="/contact">Contact</a></li>
66-
</ul>
67-
</div>
68-
</nav>
69-
</footer>
44+
<div>
45+
<ul id="footer-menu">
46+
<li><a href="/about">About</a></li>
47+
<li><a href="/contact">Contact</a></li>
48+
</ul>
49+
</div>
7050
</body>
7151

7252
</html>
7353
```
7454

75-
In this case, there is no unique wrapper element for the terms content which is represented by all elements after the main title in the `main` element. Here selecting the whole `main` would result in selecting elements that are not part of the terms content, like the breadcrumb and sub navigation. The range selector can be used to select the terms content by specifying the main title `#terms-title` as the start point and the footer `#page-footer` as the end point. The selection starts *before* the main title, so it includes it, and ends *before* the footer, so it excludes it.
55+
In this case, there is no unique wrapper element for the terms content which is represented by all elements after the main title in the `main` element. Here selecting the whole `main` would result in selecting elements that are not part of the terms content, like the breadcrumb and sub navigation. The range selector can be used to select the terms content by specifying the main title `#terms-title` as the start point and the footer `#footer-menu` as the end point. The selection starts *before* the main title, so it includes it, and ends *before* the footer, so it excludes it.
7656

7757
So the resulting range selector is:
7858

7959
```json
8060
{
8161
"startBefore": "#terms-title",
82-
"endBefore": "#page-footer"
62+
"endBefore": "#footer-menu"
8363
}
8464
```
8565

0 commit comments

Comments
 (0)