跳至內容

模板:Hanging indent inline/doc

維基文庫,自由的圖書館

用法

[編輯]

Inline hanging indent template, for use on a single long line in poems or other text where explicit text wrapping is needed. The default inset is 2em when one parameter (the line to wrap) is used, but a custom hanging indent can be specified by giving a valid CSS unit as the first parameter (bumping the line to wrap to the second parameter). Note that as the template achieves its effect by turning the line into an inline-block, no explicit <br> should be used after the wrapped line (it will generate a double line break).

參數

[編輯]

One parameter (default indent)

[編輯]
Example
Short line before long line.<br>
''{{hin|{{lorem ipsum}}}}''
Short line after long line.
Produces

Short line before long line.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Short line after long line.

Two parameters (custom indent)

[編輯]
Example
Short line before long line.<br>
''{{hin|5em|{{lorem ipsum}}}}''
Short line after long line.
Produces

Short line before long line.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Short line after long line.


Example
天地玄黃,宇宙洪荒。<br>
''{{hin|2em|ml=3em|天地玄黃,宇宙洪荒。日月盈昃,辰宿列張。寒來暑往,秋收冬藏。閏餘成歲,律召調陽。雲騰致雨,露結爲霜。金生麗水,玉出崑岡。劍號巨闕,珠稱夜光。果珍李柰,菜重芥薑。海鹹河淡,鱗潛羽翔。龍師火帝,鳥官人皇。始制文字,乃服衣裳。推位讓國,有虞陶唐。弔民伐罪,周發殷湯。坐朝問道,垂拱平章。愛育黎首,臣伏戎羌。遐邇壹體,率賓歸王。鳴鳳在樹,白駒食場。化被草木,賴及萬方。}}''
天地玄黃,宇宙洪荒。
Produces

天地玄黃,宇宙洪荒。
天地玄黃,宇宙洪荒。日月盈昃,辰宿列張。寒來暑往,秋收冬藏。閏餘成歲,律召調陽。雲騰致雨,露結爲霜。金生麗水,玉出崑岡。劍號巨闕,珠稱夜光。果珍李柰,菜重芥薑。海鹹河淡,鱗潛羽翔。龍師火帝,鳥官人皇。始制文字,乃服衣裳。推位讓國,有虞陶唐。弔民伐罪,周發殷湯。坐朝問道,垂拱平章。愛育黎首,臣伏戎羌。遐邇壹體,率賓歸王。鳴鳳在樹,白駒食場。化被草木,賴及萬方。 天地玄黃,宇宙洪荒。


Example
天地玄黃,宇宙洪荒。<br>
''{{hin|0|ml=1em|{{gap|2em}}天地玄黃,宇宙洪荒。日月盈昃,辰宿列張。寒來暑往,秋收冬藏。閏餘成歲,律召調陽。雲騰致雨,露結爲霜。金生麗水,玉出崑岡。劍號巨闕,珠稱夜光。果珍李柰,菜重芥薑。海鹹河淡,鱗潛羽翔。龍師火帝,鳥官人皇。始制文字,乃服衣裳。推位讓國,有虞陶唐。弔民伐罪,周發殷湯。坐朝問道,垂拱平章。愛育黎首,臣伏戎羌。遐邇壹體,率賓歸王。鳴鳳在樹,白駒食場。化被草木,賴及萬方。}}''
天地玄黃,宇宙洪荒。
Produces

天地玄黃,宇宙洪荒。
天地玄黃,宇宙洪荒。日月盈昃,辰宿列張。寒來暑往,秋收冬藏。閏餘成歲,律召調陽。雲騰致雨,露結爲霜。金生麗水,玉出崑岡。劍號巨闕,珠稱夜光。果珍李柰,菜重芥薑。海鹹河淡,鱗潛羽翔。龍師火帝,鳥官人皇。始制文字,乃服衣裳。推位讓國,有虞陶唐。弔民伐罪,周發殷湯。坐朝問道,垂拱平章。愛育黎首,臣伏戎羌。遐邇壹體,率賓歸王。鳴鳳在樹,白駒食場。化被草木,賴及萬方。 天地玄黃,宇宙洪荒。

參見

[編輯]