📜  Tailwind CSS 滚动行为

📅  最后修改于: 2021-09-01 01:58:52             🧑  作者: Mango

这个类在顺风 CSS 中接受多个值。它是 CSS Overscroll-behavior 属性的替代品。此类用于设置到达滚动区域边界时浏览器的行为。此属性可用于防止在有多个滚动区域的页面中进行不必要的滚动。

CSS Overscroll-behavior-x和 CSS 中有单独的属性 CSS Overflow-behavior-y ,但我们将在这篇文章中介绍它。

过度滚动行为类:

  • 自动滚动
  • 过度滚动
  • 无过度滚动
  • 自动滚动
  • overscroll-y-包含
  • overscroll-y-none
  • overscroll-x-自动
  • overscroll-x-包含
  • overscroll-x-无

overscroll-auto:用于将滚动行为设置为默认。即使到达元素的边界,整个页面和元素也会滚动。它是默认值。

句法:

...

例子:

HTML


    

  

    
        

            GeeksforGeeks         

           Tailwind CSS Overscroll Class                    
            
                This portal has been created to provide well                 written, well thought and well explained                  solutions for selected questions. An IIT                  Roorkee alumnus and founder of GeeksforGeeks.                  He loves to solve programming problems in                  most efficient ways. Apart from GeeksforGeeks,                 he has worked with DE Shaw and Co. as a                  software developer and JIIT Noida as an                  assistant professor.             
               
                This is a smaller element that is also                  scrollable. The overscroll behavior can                  be used to control if the main content                  behind would scroll when this element's                  vertical boundary is reached.             
        
    
  


HTML
 
 
     
 
  
 
    

        GeeksforGeeks     

      Tailwind CSS Overscroll Class      
    
      This portal has been created to provide well written,          well thought and well explained solutions for selected          questions. An IIT Roorkee alumnus and founder of          GeeksforGeeks. He loves to solve programming problems         in most efficient ways. Apart from GeeksforGeeks, he          has worked with DE Shaw and Co. as a software developer          and JIIT Noida as an assistant professor.     
      
      This is a smaller element that is also        scrollable. The overscroll behavior        can be used to control if the main        content behind would scroll when this        element's vertical boundary is reached.     
    
    


HTML
 
 
     
 
  
 
    

        GeeksforGeeks     

      Tailwind CSS Overscroll Class      
    
      This portal has been created to provide well written,          well thought and well explained solutions for selected          questions. An IIT Roorkee alumnus and founder of          GeeksforGeeks. He loves to solve programming problems         in most efficient ways. Apart from GeeksforGeeks, he          has worked with DE Shaw and Co. as a software developer          and JIIT Noida as an assistant professor.     
      
      This is a smaller element that is also        scrollable. The overscroll behavior        can be used to control if the main        content behind would scroll when this        element's vertical boundary is reached.     
    
    


HTML
 
 
     
 
  
 
    

        GeeksforGeeks     

      Tailwind CSS overscroll-behavior-y Class      
    
      This portal has been created to provide well written,          well thought and well explained solutions for selected          questions. An IIT Roorkee alumnus and founder of          GeeksforGeeks. He loves to solve programming problems         in most efficient ways. Apart from GeeksforGeeks, he          has worked with DE Shaw and Co. as a software developer          and JIIT Noida as an assistant professor.     
      
      This is a smaller element that is also        scrollable. The overscroll behavior        can be used to control if the main        content behind would scroll when this        element's vertical boundary is reached.     
    
    


HTML
 
 
     
 
  
 
    

        GeeksforGeeks     

      Tailwind CSS overscroll-behavior-y Class      
    
      This portal has been created to provide well written,          well thought and well explained solutions for selected          questions. An IIT Roorkee alumnus and founder of          GeeksforGeeks. He loves to solve programming problems         in most efficient ways. Apart from GeeksforGeeks, he          has worked with DE Shaw and Co. as a software developer          and JIIT Noida as an assistant professor.     
      
      This is a smaller element that is also        scrollable. The overscroll behavior        can be used to control if the main        content behind would scroll when this        element's vertical boundary is reached.     
    
    


HTML
 
 
     
 
  
 
    

        GeeksforGeeks     

      Tailwind CSS overscroll-behavior-y Class      
    
      This portal has been created to provide well written,          well thought and well explained solutions for selected          questions. An IIT Roorkee alumnus and founder of          GeeksforGeeks. He loves to solve programming problems         in most efficient ways. Apart from GeeksforGeeks, he          has worked with DE Shaw and Co. as a software developer          and JIIT Noida as an assistant professor.     
      
      This is a smaller element that is also        scrollable. The overscroll behavior        can be used to control if the main        content behind would scroll when this        element's vertical boundary is reached.     
    
    


HTML
 
 
     
 
  
 
    

        GeeksforGeeks     

      Tailwind CSS overscroll-behavior-x Class      
    
      This portal has been created to provide well written,          well thought and well explained solutions for selected          questions. An IIT Roorkee alumnus and founder of          GeeksforGeeks. He loves to solve programming problems         in most efficient ways. Apart from GeeksforGeeks, he          has worked with DE Shaw and Co. as a software developer          and JIIT Noida as an assistant professor.     
      
      This is a smaller element that is also        scrollable. The overscroll behavior        can be used to control if the main        content behind would scroll when this        element's vertical boundary is reached.     
    
    


HTML
 
 
     
 
  
 
    

        GeeksforGeeks     

      Tailwind CSS overscroll-behavior-x Class      
    
      This portal has been created to provide well written,          well thought and well explained solutions for selected          questions. An IIT Roorkee alumnus and founder of          GeeksforGeeks. He loves to solve programming problems         in most efficient ways. Apart from GeeksforGeeks, he          has worked with DE Shaw and Co. as a software developer          and JIIT Noida as an assistant professor.     
      
      This is a smaller element that is also        scrollable. The overscroll behavior        can be used to control if the main        content behind would scroll when this        element's vertical boundary is reached.     
    
    


HTML
 
 
     
 
  
 
    

        GeeksforGeeks     

      Tailwind CSS overscroll-behavior-x Class      
    
      This portal has been created to provide well written,          well thought and well explained solutions for selected          questions. An IIT Roorkee alumnus and founder of          GeeksforGeeks. He loves to solve programming problems         in most efficient ways. Apart from GeeksforGeeks, he          has worked with DE Shaw and Co. as a software developer          and JIIT Noida as an assistant professor.     
      
      This is a smaller element that is also        scrollable. The overscroll behavior        can be used to control if the main        content behind would scroll when this        element's vertical boundary is reached.     
    
    


输出:

overscroll-contain:用于将滚动行为设置为仅在使用的元素上默认。在元素到达边界后进一步滚动元素不会滚动其后面的元素。在相邻的滚动区域中不会发生滚动链接。

句法:

...

例子:

HTML

 
 
     
 
  
 
    

        GeeksforGeeks     

      Tailwind CSS Overscroll Class      
    
      This portal has been created to provide well written,          well thought and well explained solutions for selected          questions. An IIT Roorkee alumnus and founder of          GeeksforGeeks. He loves to solve programming problems         in most efficient ways. Apart from GeeksforGeeks, he          has worked with DE Shaw and Co. as a software developer          and JIIT Noida as an assistant professor.     
      
      This is a smaller element that is also        scrollable. The overscroll behavior        can be used to control if the main        content behind would scroll when this        element's vertical boundary is reached.     
    
    

输出:

overscroll-none:用于防止在所有元素上滚动链接。还防止了默认的滚动溢出行为。

句法:

...

例子:

HTML

 
 
     
 
  
 
    

        GeeksforGeeks     

      Tailwind CSS Overscroll Class      
    
      This portal has been created to provide well written,          well thought and well explained solutions for selected          questions. An IIT Roorkee alumnus and founder of          GeeksforGeeks. He loves to solve programming problems         in most efficient ways. Apart from GeeksforGeeks, he          has worked with DE Shaw and Co. as a software developer          and JIIT Noida as an assistant professor.     
      
      This is a smaller element that is also        scrollable. The overscroll behavior        can be used to control if the main        content behind would scroll when this        element's vertical boundary is reached.     
    
    

输出:

Overscroll-behavior-y:该类用于设置浏览器到达滚动区域的垂直边界时的行为。这可以用于有多个滚动区域并且滚动一个区域不会影响整个页面的网站。这种效果被称为滚动链,可以相应地启用或禁用。

overscroll-y-auto:这用于将 y 轴上的滚动行为设置为所有元素的默认值。即使到达元素的边界,整个页面也会滚动。它是默认值。

句法:

...

例子:

HTML

 
 
     
 
  
 
    

        GeeksforGeeks     

      Tailwind CSS overscroll-behavior-y Class      
    
      This portal has been created to provide well written,          well thought and well explained solutions for selected          questions. An IIT Roorkee alumnus and founder of          GeeksforGeeks. He loves to solve programming problems         in most efficient ways. Apart from GeeksforGeeks, he          has worked with DE Shaw and Co. as a software developer          and JIIT Noida as an assistant professor.     
      
      This is a smaller element that is also        scrollable. The overscroll behavior        can be used to control if the main        content behind would scroll when this        element's vertical boundary is reached.     
    
    

输出:

overscroll-y-contain:用于将 y 轴上的滚动行为设置为仅在使用的元素上默认。相邻的滚动区域不会发生滚动链,后面的元素也不会滚动。

句法:

...

例子:

HTML

 
 
     
 
  
 
    

        GeeksforGeeks     

      Tailwind CSS overscroll-behavior-y Class      
    
      This portal has been created to provide well written,          well thought and well explained solutions for selected          questions. An IIT Roorkee alumnus and founder of          GeeksforGeeks. He loves to solve programming problems         in most efficient ways. Apart from GeeksforGeeks, he          has worked with DE Shaw and Co. as a software developer          and JIIT Noida as an assistant professor.     
      
      This is a smaller element that is also        scrollable. The overscroll behavior        can be used to control if the main        content behind would scroll when this        element's vertical boundary is reached.     
    
    

输出:

overscroll-y-none:用于防止所有元素在 y 轴上滚动链接。还防止了默认的滚动溢出行为。

句法:

...

例子:

HTML

 
 
     
 
  
 
    

        GeeksforGeeks     

      Tailwind CSS overscroll-behavior-y Class      
    
      This portal has been created to provide well written,          well thought and well explained solutions for selected          questions. An IIT Roorkee alumnus and founder of          GeeksforGeeks. He loves to solve programming problems         in most efficient ways. Apart from GeeksforGeeks, he          has worked with DE Shaw and Co. as a software developer          and JIIT Noida as an assistant professor.     
      
      This is a smaller element that is also        scrollable. The overscroll behavior        can be used to control if the main        content behind would scroll when this        element's vertical boundary is reached.     
    
    

输出:

Overscroll-behavior-x:这个类用于设置浏览器在达到滚动区域的水平边界时的行为。这可以用于有多个滚动区域并且滚动一个区域不会影响整个页面的网站。

overscroll-x-auto:用于将 x 轴上的滚动行为设置为所有元素的默认值。即使到达元素的边界,整个页面也会滚动。它是默认值。

句法:

...

例子:

HTML

 
 
     
 
  
 
    

        GeeksforGeeks     

      Tailwind CSS overscroll-behavior-x Class      
    
      This portal has been created to provide well written,          well thought and well explained solutions for selected          questions. An IIT Roorkee alumnus and founder of          GeeksforGeeks. He loves to solve programming problems         in most efficient ways. Apart from GeeksforGeeks, he          has worked with DE Shaw and Co. as a software developer          and JIIT Noida as an assistant professor.     
      
      This is a smaller element that is also        scrollable. The overscroll behavior        can be used to control if the main        content behind would scroll when this        element's vertical boundary is reached.     
    
    

输出:

overscroll-x-contain:用于将 x 轴上的滚动行为设置为仅在使用的元素上默认。相邻的滚动区域不会发生滚动链,后面的元素也不会滚动。

句法:

...

例子:

HTML

 
 
     
 
  
 
    

        GeeksforGeeks     

      Tailwind CSS overscroll-behavior-x Class      
    
      This portal has been created to provide well written,          well thought and well explained solutions for selected          questions. An IIT Roorkee alumnus and founder of          GeeksforGeeks. He loves to solve programming problems         in most efficient ways. Apart from GeeksforGeeks, he          has worked with DE Shaw and Co. as a software developer          and JIIT Noida as an assistant professor.     
      
      This is a smaller element that is also        scrollable. The overscroll behavior        can be used to control if the main        content behind would scroll when this        element's vertical boundary is reached.     
    
    

输出:

overscroll-x-none:用于防止所有元素在 x 轴上滚动链接。还防止了默认的滚动溢出行为。

句法:

...

例子:

HTML

 
 
     
 
  
 
    

        GeeksforGeeks     

      Tailwind CSS overscroll-behavior-x Class      
    
      This portal has been created to provide well written,          well thought and well explained solutions for selected          questions. An IIT Roorkee alumnus and founder of          GeeksforGeeks. He loves to solve programming problems         in most efficient ways. Apart from GeeksforGeeks, he          has worked with DE Shaw and Co. as a software developer          and JIIT Noida as an assistant professor.     
      
      This is a smaller element that is also        scrollable. The overscroll behavior        can be used to control if the main        content behind would scroll when this        element's vertical boundary is reached.     
    
    

输出: