0
votes

Comment ajouter une barre de défilement transparente dans React?

J'ai ajouté le débordement-y: Faites défiler jusqu'à Matérialiser les collections depuis que je définis la hauteur d'emballage fixe. Cependant, je cherche à faire les barres de défilement transparentes. J'ai trouvé des questions et des réponses sur l'ajout de webkit. Mais il jette des erreurs et je sais que ce ne sont pas additionnels dans réagis. J'ai essayé avec CSS externe avec un identifiant spécifique. Mais ça ne marche toujours pas. Les contenus sont vraiment laids à mes yeux avec la barre de défilement. xxx

ci-dessous est le réacteur. xxx

note - J'utilise chrome et développant avec réaction, Babel CDNS. < / p>


2 commentaires

Pouvez-vous nous montrer le code où vous avez essayé d'ajouter webkit défiler des barres de défilement?


Je viens d'éditer @agney


3 Réponses :


0
votes

Vous pouvez également essayer ceci:

#no-scroll1::-webkit-scrollbar {
  width: auto;
}
#no-scroll1::-webkit-scrollbar-track, #no-scroll1::-webkit-scrollbar-thumb {
  background: transparent;
}


0 commentaires

0
votes

Vérifiez l'extrait et la mise en œuvre de Stackblitz réagit, Stackblitz Demo .

P>

<div id="no-scroll1" class="col s2 z-depth-2 grey lighten-5 no-scroll" style="height: 10em; width:200px; overflow-y: scroll">
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>

</div>


2 commentaires

Si vous utilisez largeur: 0PX . Quel est le cas pour utiliser arrière-plan: transparent ?


@Nipunjain Je ne suis pas un expert en CSS, je viens de recréer ses propriétés CSS à la fois Stackblitz et l'extrait :)



0
votes

défaut:

après:

xxx


1 commentaires

Bonjour et bienvenue à Stackoverflow, et merci d'avoir répondu. Bien que ce code puisse répondre à la question, pouvez-vous envisager d'ajouter des explications à ce que le problème était résolu et comment vous l'avez résolu? Cela aidera les futurs lecteurs à mieux comprendre votre réponse et en apprendre.