模板:Hanging indent inline

(重定向自Template:Hin

{{{1}}}

文档图示 模板文档[查看] [编辑] [历史] [清除缓存]

用法

编辑

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

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

参见

编辑