📜  HTML | DOM 样式引用属性

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

HTML DOM 中的样式引号属性用于表示 HTML < q > 元素。
此标签用于设置/返回嵌入引用的引号类型。可以使用getElementById()方法访问此元素。

句法:

  • 获取属性:
    object.style.quotes
  • 要设置属性:
    object.style.quotes = "none|string string string string|
    initial|inherit"
    

返回值:返回标签的引用类型。

属性值:

  • 无:这是默认值。它指定开引号和闭引号值不会产生任何引号。
  • 字符串 字符串 字符串 字符串:指定要使用的引号。前两个值定义了第一级引用嵌入,后两个值定义了第二级引用嵌入,依此类推
  • 初始:将此属性设置为其默认值。
  • 继承:从其父元素继承此属性。

引号字符和实体编号:

Quotation Marks Entity Numbers
double Quote \0022
single quote \0027
single, left angle quote \2039
single, right angle quote \203A
double, left angle quote \00AB
double, right angle quote \00BB
left quote (single high-6) \2018
right quote (single high-9) \2019
left quote (double high-6) \201C
right quote (double high-9) \201D
double quote (double low-9) \201E

示例 1:更改引号属性。

 
 
     
        DOM Style quotes Property  
     
        
     
        
              

                  GeeksForGeeks              

                                            DOM Style quotes Property                           
                                                       
         

输出

  • 点击按钮前:
  • 点击按钮后:

示例 2:使用实体编号更改引号属性。

 
 
     
        DOM Style quotes Property  
     
        
     
        
              

                  GeeksForGeeks              

                                            DOM Style quotes Property                           
                                                       
                          

输出

  • 点击按钮前:
  • 点击按钮后:

支持的浏览器: HTML支持的浏览|下面列出了DOM 样式引用属性

  • 谷歌浏览器
  • 边缘
  • 火狐浏览器
  • 歌剧
  • 苹果浏览器