azimuth

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2020.

Thuộc tính azimuth chỉ định góc phương vị của nguồn sáng trên mặt phẳng XY (theo chiều kim đồng hồ), tính bằng độ từ trục x.

Bạn có thể dùng thuộc tính này với phần tử SVG sau:

Ví dụ

html
<svg viewBox="0 0 440 200" xmlns="http://www.w3.org/2000/svg">
  <filter id="distantLight1">
    <feDiffuseLighting>
      <feDistantLight azimuth="0" />
    </feDiffuseLighting>
  </filter>
  <filter id="distantLight2">
    <feDiffuseLighting>
      <feDistantLight azimuth="240" />
    </feDiffuseLighting>
  </filter>

  <circle cx="100" cy="100" r="80" filter="url(#distantLight1)" />
  <circle cx="340" cy="100" r="80" filter="url(#distantLight2)" />
</svg>

Lưu ý sử dụng

Giá trị <number>
Giá trị mặc định 0
Có thể animate

Thông số kỹ thuật

Specification
Filter Effects Module Level 1
# element-attrdef-fedistantlight-azimuth

Tương thích trình duyệt