Tài liệu bản mẫu[xem] [sửa] [lịch sử] [làm mới]

Cách sử dụng sửa

The template {{Inline block}} creates an element—by default a <span>—that has the CSS property display: inline-block;. There is support for a range of common style properties as template parameters, and an all-purpose style parameter.

One intended use is to replace {{nowrap}} when coding templates with complex layout, which need to display differently on mobile and desktop. Like {{nowrap}}, it holds content together and avoids wrapping it where possible. However, if necessary, such as on small screens, the content will wrap.

Ví dụ về điều khiển bao bọc sửa

In each case the outline represents a width constraint, which might be affected by the user's screen size, other parts of the template, or both.

1 (đỏ)=Chất khí3 (đen)=Chất rắn80 (lục)=Chất lỏngMàu của số nguyên tử cho thấy trạng thái vật chất (tại 0 °C và 1 atm)
1 (đỏ)=Chất khí3 (đen)=Chất rắn80 (lục)=Chất lỏngMàu của số nguyên tử cho thấy trạng thái vật chất (tại 0 °C và 1 atm)
1 (đỏ)=Chất khí3 (đen)=Chất rắn80 (lục)=Chất lỏngMàu của số nguyên tử cho thấy trạng thái vật chất (tại 0 °C và 1 atm)

Here, each grey box and the text "Color of ..." are wrapped in {{inline block}} templates. If {{nowrap}} had been used instead, there would be no visible difference in the first two cases. In the third case, however, the text would have been unable to wrap into the space available. On mobile, this might mean that a table or the whole article is forced to become horizontally scrollable.

Dữ liệu bản mẫu sửa

Đây là tài liệu Dữ liệu bản mẫu cho bản mẫu này được sử dụng bởi Trình soạn thảo trực quan và các công cụ khác; xem báo cáo sử dụng tham số hàng tháng cho bản mẫu này.

Dữ liệu bản mẫu cho Inline block

The template {{Inline block}} creates an inline-block element. Among other uses, it can replace {{nowrap}} when coding templates with complex layout.
Tham sốMiêu tảKiểuTrạng thái
Content1
The content to be wrapped in an inline-block element
Nội dungbắt buộc
Tag name2
Changes the HTML tag used. This may affect what elements this template should contain or be contained by.
Mặc định
span
Ví dụ
div, abbr
Chuỗi dàitùy chọn
Titletitle
Title of the content (used as tooltip text, or expanded abbreviation when 2=abbr
Ví dụ
died (for abbr d.)
Chuỗi dàitùy chọn
Widthwidth
The width; passed directly to the "width" CSS attribute
Chuỗi dàitùy chọn
Heightheight
The height; passed directly to the "height" CSS attribute
Chuỗi dàitùy chọn
Text colorcolor
The text color; passed directly to the "color" CSS attribute
Chuỗi dàitùy chọn
Background formattingbackground
bg
The background formatting; passed directly to the "background" CSS attribute
Chuỗi dàitùy chọn
Other stylesstyle
Style information as plain CSS.
Chuỗi dàitùy chọn
Thử nghiệm của đầu ra Dữ liệu bản mẫu raw:

The template {{Inline block}} creates an inline-block element. Among other uses, it can replace {{nowrap}} when coding templates with complex layout.

Tham số bản mẫu

Tham sốMiêu tảKiểuTrạng thái
Content1

The content to be wrapped in an inline-block element

Nội dungbắt buộc
Tag name2

Changes the HTML tag used. This may affect what elements this template should contain or be contained by.

Mặc định
span
Ví dụ
div, abbr
Chuỗi dàitùy chọn
Titletitle

Title of the content (used as tooltip text, or expanded abbreviation when 2=abbr

Mặc định
Ví dụ
died (for abbr d.)
Chuỗi dàitùy chọn
Widthwidth

The width; passed directly to the "width" CSS attribute

Chuỗi dàitùy chọn
Heightheight

The height; passed directly to the "height" CSS attribute

Chuỗi dàitùy chọn
Text colorcolor

The text color; passed directly to the "color" CSS attribute

Chuỗi dàitùy chọn
Background formattingbackground bg

The background formatting; passed directly to the "background" CSS attribute

Chuỗi dàitùy chọn
Other stylesstyle

Style information as plain CSS.

Chuỗi dàitùy chọn

Xem thêm sửa

  • {{nowrap}} ngăn chặn bao bọc trong một bản mẫu duy nhất (nghĩa là không phù hợp với nội dung tương đối phức tạp hoặc dài dòng).
  • {{Nowraplinks}}...{{Nowraplinks end}} ngăn chặn các bao bọc bên trong các liên kết trong khi cho phép các bao bọc giữa các liên kết và trong văn bản bình thường. Rất hữu ích cho danh sách liên kết và dễ sử dụng.
  • {{Nowrap begin}}...{{Nowrap end}} ngăn chặn các bao bọc trong cả văn bản và liên kết. Đối với các trường hợp bao bọc phức tạp hơn khi bạn cần kiểm soát hoàn toàn, ví dụ trong danh sách liên kết rất phức tạp.
  • {{Spaces}} để tạo nhiều khoảng cách không ngắt dòng (hoặc một khoảng cách duy nhất).
  • {{Inline block}} ảnh hưởng, nhưng không hoàn toàn ngăn chặn, bao bọc dòng.
  • {{Allow wrap}} có thể được sử dụng để cung cấp ngoại lệ (ngắn gọn) trong khu vực không bao bọc.
    • {{Normalwraplink}} cho phép các liên kết bao bọc khi chúng không hoạt động.
  • {{·}}{{•}}, khoảng cách và bao bọc nhạy cảm dấu chấm giữa (dấu chấm nhỏ) và dấu chấm to.
  • Wikipedia:Xử lý ngắt dòng, hướng dẫn cách thực hiện về từ/bao bọc dòng/ngắt dòng tại Wikipedia.
    • Cụ thể, để tránh việc bao bọc dòng khi trích dẫn một đoạn như bài thơ hoặc mã máy tính, hãy xem {{Quote#Ngắt dòng}} - ví dụ: Bản mẫu:Blockquote với thẻ "bài thơ".