模板:Left margin/doc
本文档是Template: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: