📜  HTML | DOM 样式 borderLeftWidth 属性

📅  最后修改于: 2021-10-29 03:46:12             🧑  作者: Mango

DOM Style borderLeftWidth属性用于设置返回元素左边框的宽度

句法:

  • 获取 borderLeftWidth 属性
    object.style.borderLeftWidth
  • 设置 borderLeftWidth 属性
    object.style.borderLeftWidth = "thin | medium | thick | length |
    initial | inherit"

属性值:

  1. 细:这用于定义一个细的左边框。

    示例 1:

    
    
      
    
        
          DOM Style BorderLeftWidth
        
      
        
    
      
    
        

          GeeksforGeeks     

               DOM Style BorderLeftWidth          

            GeeksforGeeks is a computer science       portal with a huge variety of well written and       explained computer science and programming       articles, quizzes and interview questions.     

                        

    输出:

    点击按钮前:

    瘦身

    点击按钮后:

    瘦身

  2. medium:这用于定义中等左边框。这是默认值。

    示例 2:

    
    
      
    
        
          DOM Style BorderLeftWidth
        
        
    
      
    
        

          GeeksforGeeks     

               DOM Style BorderLeftWidth          

            GeeksforGeeks is a computer science       portal with a huge variety of well       written and explained computer        science and programming articles,        quizzes and interview questions.     

                        

    输出:

    点击按钮前:

    中前

    点击按钮后:

    中后

  3. 厚:这用于定义厚的左边框。

    示例 3:

    
    
      
    
        
          DOM Style BorderLeftWidth
        
      
        
    
      
    
        

          GeeksforGeeks     

               DOM Style BorderLeftWidth          

          GeeksforGeeks is a computer science       portal with a huge variety of well       written and explained computer science       and programming articles, quizzes        and interview questions.     

                        

    输出:

    点击按钮前:

    厚厚的

    点击按钮后:

    厚后

  4. length:这用于根据长度单位定义左边框宽度。

    示例 4:

    
    
      
    
        
          DOM Style BorderLeftWidth
        
      
        
    
      
    
        

          GeeksforGeeks     

               DOM Style BorderLeftWidth          

          GeeksforGeeks is a computer science portal       with a huge variety of well written and        explained computer science and programming       articles, quizzes and interview questions.     

                        

    输出:

    点击按钮前:

    前长度

    点击按钮后:

    后长度

  5. 初始值:用于将此属性设置为其默认值。

    示例 5:

    
    
      
    
        
          DOM Style BorderLeftWidth
        
      
        
    
      
    
        

          GeeksforGeeks     

               DOM Style BorderLeftWidth          

            GeeksforGeeks is a computer science portal       with a huge variety of well written and explained       computer science and programming articles, quizzes       and interview questions.     

                        

    输出:

    点击按钮前:

    初始之前

    点击按钮后:

    初始之后

  6. 继承:这从其父级继承属性。

    示例 6:

    
    
      
    
        
          DOM Style BorderLeftWidth
        
      
        
    
      
    
        

          GeeksforGeeks     

               DOM Style BorderLeftWidth          
        
        
            

                GeeksforGeeks is a computer science           portal with a huge variety of well           written and explained computer science           and programming articles, quizzes and           interview questions.         

        
        
                        

    输出:

    点击按钮前:

    先继承

    点击按钮后:

    继承

    支持的浏览器: borderLeftWidth属性支持的浏览器如下:

    • 谷歌浏览器
    • IE浏览器
    • 火狐
    • 歌剧
    • 苹果Safari