aboutsummaryrefslogtreecommitdiff
path: root/files/fr/web/css/scroll-snap-destination/index.md
diff options
context:
space:
mode:
Diffstat (limited to 'files/fr/web/css/scroll-snap-destination/index.md')
-rw-r--r--files/fr/web/css/scroll-snap-destination/index.md147
1 files changed, 147 insertions, 0 deletions
diff --git a/files/fr/web/css/scroll-snap-destination/index.md b/files/fr/web/css/scroll-snap-destination/index.md
new file mode 100644
index 0000000000..288e0529c9
--- /dev/null
+++ b/files/fr/web/css/scroll-snap-destination/index.md
@@ -0,0 +1,147 @@
+---
+title: scroll-snap-destination
+slug: Web/CSS/scroll-snap-destination
+tags:
+ - CSS
+ - Déprécié
+ - Propriété
+ - Reference
+translation_of: Web/CSS/scroll-snap-destination
+---
+<div>{{CSSRef}}{{deprecated_header}}</div>
+
+<p>La propriété <strong><code>scroll-snap-destination</code></strong> définit les coordonnées horizontale et verticale des points d'accroche dans le {{Glossary("viewport")}} du conteneur.</p>
+
+<pre class="brush: css no-line-numbers">/* Valeur &lt;position&gt; */
+scroll-snap-destination: 400px 600px;
+
+/* Valeurs globales */
+scroll-snap-destination: inherit;
+scroll-snap-destination: initial;
+scroll-snap-destination: unset;
+</pre>
+
+<h2 id="Syntaxe">Syntaxe</h2>
+
+<h3 id="Valeurs">Valeurs</h3>
+
+<dl>
+ <dt><code>&lt;position&gt;</code></dt>
+ <dd>Définit le décalage entre le bord du viewport du conteneur et le point d'accroche à utiliser lors du défilement. La première valeur indique la coordonnée horizontale et la seconde indique la coordonnée verticale.</dd>
+</dl>
+
+<h3 id="Syntaxe_formelle">Syntaxe formelle</h3>
+
+{{csssyntax}}
+
+<h2 id="Exemples">Exemples</h2>
+
+<h3 id="HTML">HTML</h3>
+
+<pre class="brush: html">&lt;div id="container"&gt;
+ &lt;div&gt;
+ &lt;p&gt;Coordonnées (0, 0)&lt;/p&gt;
+ &lt;div class="scrollContainer destination0"&gt;
+   &lt;div&gt;1&lt;/div&gt;
+   &lt;div&gt;2&lt;/div&gt;
+   &lt;div&gt;3&lt;/div&gt;
+ &lt;/div&gt;
+ &lt;/div&gt;
+
+ &lt;div&gt;
+ &lt;p&gt;Coordonnées (25, 0)&lt;/p&gt;
+ &lt;div class="scrollContainer destination25"&gt;
+   &lt;div&gt;1&lt;/div&gt;
+   &lt;div&gt;2&lt;/div&gt;
+   &lt;div&gt;3&lt;/div&gt;
+ &lt;/div&gt;
+ &lt;/div&gt;
+
+ &lt;div&gt;
+ &lt;p&gt;Coordonnées (50, 0)&lt;/p&gt;
+ &lt;div class="scrollContainer destination50"&gt;
+   &lt;div&gt;1&lt;/div&gt;
+   &lt;div&gt;2&lt;/div&gt;
+   &lt;div&gt;3&lt;/div&gt;
+ &lt;/div&gt;
+ &lt;/div&gt;
+&lt;/div&gt;
+</pre>
+
+<h3 id="CSS">CSS</h3>
+
+<pre class="brush: css">#container {
+ display: flex;
+}
+
+#container &gt; div:nth-child(-n+2) {
+ margin-right: 20px;
+}
+
+.scrollContainer {
+ width: 100px;
+ overflow: auto;
+ white-space: nowrap;
+ scroll-snap-points-x: repeat(100%);
+ scroll-snap-type: mandatory;
+ scroll-snap-destination: 20px 0;
+ font-size: 0;
+}
+
+.destination0 {
+ scroll-snap-destination: 0 0;
+}
+
+.destination25 {
+ scroll-snap-destination: 25px 0;
+}
+
+.destination50 {
+ scroll-snap-destination: 50px 0;
+}
+
+.scrollContainer &gt; div {
+ width: 100px;
+ height: 100px;
+ display: inline-block;
+ line-height: 100px;
+ text-align: center;
+ font-size: 50px;
+}
+
+.scrollContainer &gt; div:nth-child(even) {
+ background-color: #87EA87;
+}
+
+.scrollContainer &gt; div:nth-child(odd) {
+ background-color: #87CCEA;
+}</pre>
+
+<h3 id="Résultat">Résultat</h3>
+
+<p>{{EmbedLiveSample("Exemples", "100%", "170")}}</p>
+
+<h2 id="Spécifications">Spécifications</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">Spécification</th>
+ <th scope="col">État</th>
+ <th scope="col">Commentaires</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName("CSS Scroll Snap Points", "#propdef-scroll-snap-destination", "scroll-snap-destination")}}</td>
+ <td>{{Spec2("CSS Scroll Snap Points")}}</td>
+ <td>Définition initiale.</td>
+ </tr>
+ </tbody>
+</table>
+
+<p>{{cssinfo}}</p>
+
+<h2 id="Compatibilité_des_navigateurs">Compatibilité des navigateurs</h2>
+
+<p>{{Compat("css.properties.scroll-snap-destination")}}</p>