CSS border-left-color Property

Thuộc tính

border-left-color

được dùng để đặt màu cho đường viền bên trái của một phần tử.

Việc khai báo border-style hoặc border-left-style trước là bắt buộc. Điều này cần thực hiện trước thuộc tính border-left-color.

Cú pháp:

border-left-color: color|transparent|initial|inherit; 

Giá trị thuộc tính

color:

Thuộc tính này đặt màu cho đường viền bên trái của phần tử.

  • Cú pháp:
    border-left-color: color
  • Ví dụ: html
    <!DOCTYPE html>
    <html>
    
    <head>
        <title>
            CSS | border-left-color Property
        </title>
        <style>
            h1 {
                color: green;
            }
            
            h3 {
                border: 2px solid green;
                border-left-color: red;
                width: 50%;
            }
        </style>
    </head>
    
    <body>
        <center>
    
            <h1>GeeksForGeeks</h1>
            <h2>border-left-color:color;</h2>
            <h3>GeeksForGeeks</h3>
          
            <!-- Sets the color-->
            <p style="border-style:dotted; 
                      border-left-color:coral; 
                      width:70%;">
              It is a computer science portal for geeks.</p>
    
    </body>
    
    </html></li>
    
  • Đầu ra:css-border-left-color-property
  • Transparent:
  • Thuộc tính này chỉ định giá trị trong suốt cho đường viền trái.
    • Cú pháp:
      border-left-color:transparent;
    • Ví dụ: html
      <!DOCTYPE html>
      <html>
      
      <head>
          <title>
              CSS | border-left-color Property
          </title>
          <style>
              h1 {
                  color: green;
              }
              
              h3 {
                  border: 2px solid green;
                  border-left-color: transparent;
                  width: 50%;
              }
          </style>
      </head>
      
      <body>
          <center>
      
              <h1>GeeksForGeeks</h1>
              <h2>border-left-color:transparent</h2>
              <h3>GeeksForGeeks</h3>
      
              <!-- Sets the color to transparent-->
              <p style="border-style:dotted;
                        border-left-color:transparent;
                        width:70%;">
                It is a computer science portal for geeks.</p>
      
      </body>
      
      </html>
      
    • Đầu ra:css-border-left-color-property
  • initial:
  • Thuộc tính này đặt thuộc tính về giá trị mặc định ban đầu.
  • Cú pháp:
    border-left-color:initial;
  • Ví dụ: html
    <!DOCTYPE html>
    <html>
    
    <head>
        <title>
            CSS | border-left-color Property
        </title>
        <style>
            h1 {
                color: green;
            }
            
            h3 {
                border: 2px solid green;
                border-left-color: initial;
                width: 50%;
            }
        </style>
    </head>
    
    <body>
        <center>
    
            <h1>GeeksForGeeks</h1>
            <h2>border-left-color:initial;</h2>
            <h3>GeeksForGeeks</h3>
    
            <!-- Sets the color to its default value-->
            <p style="border-style:dotted;
                      border-left-color:initial;
                      width:70%;">
              It is a computer science portal for geeks.</p>
    
    </body>
    
    </html>
    
  • Đầu ra :css-border-left-color-property

Trình duyệt được hỗ trợ:

Các trình duyệt được hỗ trợ bởi

css border-left-color property

được liệt kê dưới đây:

  • Google Chrome 1.0
  • Edge 12.0
  • Internet Explorer 4.0
  • Firefox 1.0
  • Opera 3.5
  • Apple Safari 1.0

Last Updated : 21/07/2025