:-moz-last-node

Non-standard: This feature is not standardized. We do not recommend using non-standard features in production, as they have limited browser support, and may change or be removed. However, they can be a suitable alternative in specific cases where no standard option exists.

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

:-moz-last-nodelớp giả CSS là một phần mở rộng Mozilla đại diện cho bất kỳ phần tử nào là nút con cuối cùng của một phần tử khác. Nó khác với :last-child ở chỗ nó không khớp với phần tử con cuối cùng có văn bản (không phải khoảng trắng) đứng sau nó.

Note: Mọi khoảng trắng ở cuối một phần tử đều bị bỏ qua khi xác định :-moz-last-node.

Cú pháp

css
:-moz-last-node {
  /* ... */
}

Ví dụ

CSS

css
span:-moz-last-node {
  background-color: lime;
}

HTML

html
<p>
  <span>This does not match.</span>
  <span>This matches!</span>
</p>

<p>
  <span>This doesn't match because it's followed by text.</span>
  Blahblah.
</p>

Kết quả

Thông số kỹ thuật

Không thuộc bất kỳ tiêu chuẩn nào.

Khả năng tương thích trình duyệt

Xem thêm