Szablon:Dropinitial: Różnice pomiędzy wersjami

[wersja nieprzejrzana][wersja nieprzejrzana]
Usunięta treść Dodana treść
what the heck; giving it a go.
{{documentation}}
Linia 1:
<includeonly><span class="dropinitial" style="display: block; font-size: {{#ifeq:{{{2|3em}}}|3em|3em|{{{2}}}}}; line-height: 1em; float: left; margin: {{#ifeq:{{{3|0em}}}|0em|0em|{{{3}}}}} {{#ifeq:{{{4|.1em}}}|.1em|.1em|{{{4}}}}} {{#ifeq:{{{5|0em}}}|0em|0em|{{{5}}}}} {{#ifeq:{{{6|0em}}}|0em|0em|{{{6}}}}};">{{#ifeq:{{{1|A}}}|A|A|{{{1}}}}}</span></includeonly><noinclude>{{documentation}}<br style="clear:both;" /noinclude>
This template is for creating the "drop [[w:initial|initial]]" effect that is common in both modern and antiquated typography:
 
[[File:Drop initial example.jpg|center|250px|thumb|Used with parameters '''<nowiki>{{</nowiki>dropinitial{{Unicode|&#x007C;}}''L''{{Unicode|&#x007C;}}''2.4em''{{Unicode|&#x007C;}}''0em''{{Unicode|&#x007C;}}''.05em''<nowiki>}}</nowiki>''' within a block of Times New Roman text.]]
 
== To use ==
 
'''<nowiki>{{</nowiki>dropinitial|''content''|''font-size''|''margin-top''|''margin-right''|''margin-bottom''|''margin-left''<nowiki>}}</nowiki>'''.
 
The ''font-size'' parameter and margin value parameters should be specified with relative units, i.e. as a percent or in '[[w:En (typography)|en]]' or '[[w:Em (typography)|em]]' units.
 
None of the parameters are necessary, in which case the defaults are:
 
* content = A
* font-size = 3em
* margin-right = .1em
 
Which should produce a drop initial approximately the height of two lines in the current Wikisource default font.
 
<blockquote>
Note: Fonts can be rendered slightly differently in different browsers and on different operating systems. You may wish to check your work in [[w:Mozilla Firefox|Mozilla Firefox]], [[w:Safari (web browser)|Apple Safari]], [[w:Opera (web browser)|Opera]], [[w:Internet Explorer|Windows Internet Explorer]] or other [[w:List of web browsers|web browsers]] on different computers to ensure that the text wraps around the initial in the way you expect it to if you are not using the default values.
</blockquote>
 
== Typography Notes ==
 
If you simply need to have an ''enlarged'' initial in a text, which is not dropped below the baseline, use the template {{tl|largeinitial}}:
 
<blockquote>
{{largeinitial|L}}orem ipsum sit amet...
</blockquote>
 
== Technical Notes ==
 
This template simply generates a left-floated span (w/style <tt>display: block;</tt>) containing ''content'' with the proper CSS styles applied to it. Unfortunately the [http://www.w3.org/TR/css3-linebox/#Initial CSS 3 styles specifically directed at formatting drop initials] are not implemented in browsers at this point. In planning for the future this template applies a class "dropinitial" to the output span.
 
{{DEFAULTSORT:Dropinitial}}
[[Category:Typography templates]]</noinclude>