साँचा:Text-indent
यह साँचा ब्लॉक तत्वों का प्रयोग करता है, जैसे कि अधिक जानकारी के लिए अंग्रेज़ी में en:H:DIVSPAN देखें। |
This template adds indentation to text using the CSS text-indent
property. This property controls the indentation of the first line of a paragraph of text. It can be specified with any valid CSS unit, but em is the preferred unit. The indentation can be 0
to disable an inherited indent, or negative to achieve various special effects such as hanging indents (but use {{hanging indent}}
for that). The default value is 2em
.
- Note that this template should not be used to attempt to replicate the printing style where the first line of every new paragraph is indented.
See the policy on indentation of paragraphs.
Usage
[सम्पादन]The primary calling convention for this template is the block-based one:
{{ti/s|CSS unit}} … text … {{ti/e}}
For a single shorter run of text containing no characters that are significant in wikicode (equals signs in particular), you can also use the inline calling convention:
{{ti|CSS unit|text}}
For most use cases though, the block calling convention is strongly recommended as it is the most flexible and creates the fewest surprising edge cases and weird behaviour..
Arguments
[सम्पादन]This template uses positional (unnamed) parameters. If only one parameter is provided it is assumed to be a CSS length value and is passed directly into the style
attribute for the container (so make sure you provide a valid value here!). If you are using the inline calling convention you can also provide the text the template should apply to in the second unnamed parameter. In either case you can leave the indent amount empty and the template will default to 2em
.
{{ti}} |
{{ti/s}}
| |
---|---|---|
1= | length | length |
2= | text | — |
Examples
[सम्पादन]Example: basic block based calling convention
{{ti/s}}{{lorem ipsum}}{{ti/e}}
Example: with a custom length
{{ti/s|5em}}{{lorem ipsum}}{{ti/e}}
Example: overriding an inherited text-indent
{{ti/s|5em}} {{lorem ipsum}} {{ti/s|0}}{{lorem ipsum}}{{ti/e}} {{lorem ipsum}} {{ti/e}}
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.
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.
Example: hanging indent
{{left margin|2em}} {{ti/s|-2em}}{{lorem ipsum}}{{ti/e}} {{div end}}
Basic use
[सम्पादन]{{text-indent|CSS unit|text}}
For a single shorter run of text containing no characters that are significant in wikicode (equals signs in particular), you can use the inline calling convention: the amount of indentation is given in the first parameter, and the text to which it is to be applied in the second. For most use cases though, the block calling convention is strongly recommended.
Example
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.
Cui dōnō lepidum novum libellum āridā modo pūmice expolītum
Please note that the last paragraph is not indented, since there are two new lines before it. This makes MediaWiki insert a <br />
before it which "steals" the indentation.
See also
[सम्पादन]ऊपर दिया गया विवरणपृष्ठ साँचा:Text-indent/doc से ट्रांसक्लूड किया गया है। (संपादित करें | इतिहास) संपादकगण इस साँचे के sandbox (बनाएँ | मिरर करें) और testcases (बनाएँ) पन्नों पर अपने प्रयोग/परीक्षण कर सकते हैं। कृपया श्रेणियाँ /doc उपपृष्ठ पर जोड़ें। इस साँचे के उपपृष्ठ देखें। |