模板:Inline block/doc
| 當前模板的內容正在依照的內容進行翻譯。(2019年6月6日) 如果您熟知條目內容並擅長翻譯,歡迎協助改善或校對此模板,目前的翻譯進度為0%。長期閒置的非中文內容可能會被移除。 |
| 此頁面是Template:Inline block的模板文件。 此頁面可能包含了模板的使用說明、分類和其他內容。 |
| 這是 Inline block 模板的說明文件頁面。 本文件並不是為直接瀏覽而撰寫。若是其中使用了跨維基計畫連結,某些連結可能會顯示損毀。請勿將這些連結替換為硬編碼的頁面名稱或網址。 |
用法
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.
Example of wrapping control
[編輯]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.
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.
參數
[編輯]參見
[編輯]Template:List of nowrap-like templates