📜  CSS |字幕侧属性

📅  最后修改于: 2021-11-07 08:48:11             🧑  作者: Mango

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

句法:

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

默认值

  • 最佳

特性:

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

句法:

caption-side:top;

例子:

HTML


    
        caption-side property
        
    
    
        
            

GeeksForGeeks

            

caption-side: top:

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


HTML


    
        caption-side property
        
    
    
        
            

GeeksForGeeks

            

caption-side: bottom:

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


HTML


    
    
    
    
        
            

GeeksForGeeks

                          

caption-side:initial:

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


输出:

2.底部:该属性指定表格标题置于表格底部。

句法:

caption-side:bottom;

例子:

HTML



    
        caption-side property
        
    
    
        
            

GeeksForGeeks

            

caption-side: bottom:

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

输出:

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

句法:

captipn-side:initial

例子:

HTML



    
    
    
    
        
            

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