Computer >> Hướng Dẫn Máy Tính >  >> Lập Trình >> JavaScript

Cách đặt hình dạng góc viền dưới bên trái trong JavaScript DOM?

Sử dụng borderBottomLeftRadius để đặt bán kính bo góc viền dưới bên trái.

Ví dụ

<!DOCTYPE html>
<html>
  <head>
    <style>
      #box { border: 2px dashed blue; width: 120px; height: 120px; }
    </style>
  </head>
  <body>
    <button onclick="display()">Đặt góc dưới trái</button>
    <div id="box"><p>Demo Text</p><p>Demo Text</p></div>
    <script>
      function display() {
        document.getElementById("box").style.borderBottomLeftRadius = "30px";
      }
    </script>
  </body>
</html>