📜  CSS |字幕侧属性

📅  最后修改于: 2021-09-01 02:01:48             🧑  作者: Mango

此属性用于指定放置表格标题的位置。它用于 HTML 表格。此属性可用于显示属性设置为标题端的任何元素。

句法:

caption-side: top|bottom|initial|inherit;

特性:

  • top:指定表格标题放在表格的顶部。它是默认值。

    句法:

    caption-side:top;

    例子:

    
    
        
            caption-side property
            
        
        
            
                

    GeeksForGeeks

                

    caption-side: top:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
    Table 4.1 Student Details
    Student NameEnroll_no.Address
    Hritik Bhatnagar234Delhi
    Govind madan235kolkata
    Suraj Roy236Mumbai
    Dhruv Mishra237Dehadun
            
                             

    输出:

  • 底部:此属性指定表格标题位于表格底部。

    句法:

    caption-side:bottom;

    例子:

    
    
        
            caption-side property
            
        
        
            
                

    GeeksForGeeks

                

    caption-side: bottom:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
    Table 4.1 Student Details
    Student NameEnroll_no.Address
    Hritik Bhatnagar234Delhi
    Govind madan235kolkata
    Suraj Roy236Mumbai
    Dhruv Mishra237Dehadun
            
                             

    输出:

  • 初始:将属性设置为其默认值。

    句法:

    captipn-side:initial

    例子:

    
    
        
        
        
        
            
                

    GeeksForGeeks

                               

    caption-side:initial:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
    Table 4.1 Student Details
    Student NameEnroll_no.Address
    Hritik Bhatnagar234Delhi
    Govind madan235kolkata
    Suraj Roy236Mumbai
    Dhruv Mishra237Dehadun
            
                             

    输出:

支持的浏览器: CSS caption-side 属性支持的浏览器如下:

  • 谷歌浏览器 1.0
  • 浏览器 8.0
  • 火狐 1.0
  • 歌剧4.0
  • Safari 1.0