模板:Left margin
Usage
编辑This template formats text with an indented left margin; that is, an indent that applies to all lines.
- Usage
- {{Left margin|size of margin|text}}
- Example
{{Left margin|2em|{{lorem ipsum}}}}
produces:
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.
- Text-indent example
{{Left margin|2em|{{lorem ipsum}}|1em}}
produces:
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.
- Margin-right example
{{Left margin|2em|{{lorem ipsum}}||2em}}
produces:
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.
As open and close tags
编辑This template is also available in an open and close format where the <div> needs to span a page break in the Page namespace.
- {{Left margin/s}} to open
- {{Left margin/e}} to close
- Example
{{Left margin/s|3em}}{{lorem ipsum}}{{Left margin/e}}
yields
Alternative usage
编辑You can avoid to pass the text content as parameter 2, using the template as a "div begin", then closing the template with a tag </div> at the end of the text.
- Example
{{Left margin|2em}}{{lorem ipsum}}</div>
produces:
上述文档嵌入自Template:Left margin/doc。 (编辑 | 历史) 编者可以在本模板的沙盒 (创建 | 镜像)和测试样例 (创建)页面进行实验。 请在/doc子页面中添加分类。 本模板的子页面。 |