Faire son site 11 : Référence CSS - overflow-x

overflow-x

La propriété overflow-x définit la façon dont est géré l'affichage du contenu lorsque celui-ci déborde de son bloc horizontalement.

Pour que cette propriété fonctionne, il faut que la largeur du bloc soit limitée par une propriété width ou max-width et avoir la propriété white-space avec nowrap comme valeur.

Les valeurs que peut prendre la propriété overflow-x sont:

<style>
.bloc {
  width: 400px;
  height: 40px;
  border: 1px solid black;
  white-space: nowrap;
}
</style>

overflow-x: visible;
Je connais mon alphabet c'est ABCDEFGHIJKLMNOPQRSTUVWXYZ

overflow-x: hidden;
Je connais mon alphabet c'est ABCDEFGHIJKLMNOPQRSTUVWXYZ

overflow-x: scroll;
Je connais mon alphabet c'est ABCDEFGHIJKLMNOPQRSTUVWXYZ