Vorlage:Dia: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Zeile 30: | Zeile 30: | ||
Standardhöhe, rh | Standardhöhe, rh | ||
(padding-top: Umrechnung von px in % der Weite) | (padding-top: Umrechnung von px in % der Weite) | ||
+ | urspr: {{{rh|300}}} | ||
− | -->{{#vardefine:rh|{{{rh|{{#expr: {{#var:rw}}*2}}}}}}}<!-- | + | -->{{#vardefine:rh|{{{rh|{{#expr: {{#var:rw}}*2}}}}}}}<!-- |
+ | |||
+ | Abstände | ||
+ | |||
+ | -->{{#vardefine:t | ||
+ | |{{#if:{{{t|}}} | ||
+ | |{{#ifeq: {{#var:rh}} | auto | {{{t|}}}px | ||
+ | |{{#expr: {{{t|}}}/{{#var:rh}}*100}}% | ||
+ | |0}}}}}}<!-- | ||
+ | -->{{#vardefine:r| | ||
+ | |{{#if:{{{r|}}} | ||
+ | |{{#ifeq: {{#var:rh}} | auto | {{{r|}}}px | ||
+ | |{{#expr: {{{r|}}}/{{#var:rh}}*100}}% | ||
+ | |0}}}}}}<!-- | ||
+ | -->{{#vardefine:l| | ||
+ | |{{#if:{{{l|}}} | ||
+ | |{{#ifeq: {{#var:rh}} | auto | {{{l|}}}px | ||
+ | |{{#expr: {{{l|}}}/{{#var:rh}}*100}}% | ||
+ | |0}}}}}}<!-- | ||
+ | -->{{#vardefine:b| | ||
+ | |{{#if:{{{b|}}} | ||
+ | |{{#ifeq: {{#var:rh}} | auto | {{{b|}}}px | ||
+ | |{{#expr: {{{b|}}}/{{#var:rh}}*100}}% | ||
+ | |0}}}}}}<!-- | ||
+ | |||
+ | Bildweite, w | ||
+ | |||
+ | -->{{#vardefine:w | ||
+ | |{{#expr: {{#expr:({{#var:rw}}-{{#var:l}}-{{#var:r}})*6/5}} round 0}}px | ||
+ | }}<!-- | ||
-->{{#vardefine:t | -->{{#vardefine:t | ||
|{{#if:{{{t|}}} | |{{#if:{{{t|}}} | ||
Zeile 48: | Zeile 78: | ||
-->{{#vardefine:margin| margin-}}<!-- | -->{{#vardefine:margin| margin-}}<!-- | ||
-->{{#vardefine:pos_innen| static}}<!-- | -->{{#vardefine:pos_innen| static}}<!-- | ||
− | -->{{#if: {{#var:rh}}|{{#vardefine:margin|}}{{#vardefine:pos_innen| absolute}} }}<!-- | + | -->{{#if: {{#var:rh}}|{{#vardefine:margin|}}{{#vardefine:pos_innen| absolute}} }}<!-- |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
Bildweite, w | Bildweite, w | ||
Zeile 76: | Zeile 99: | ||
position:{{#var:pos_innen}}; | position:{{#var:pos_innen}}; | ||
{{#var:margin}}top:{{#var:t}}; | {{#var:margin}}top:{{#var:t}}; | ||
− | {{#var:margin}}right:{{#var:r}} | + | {{#var:margin}}right:{{#var:r}}; |
− | {{#var:margin}} | + | {{#var:margin}}left:{{#var:l}}; |
− | {{#var:margin}} | + | {{#var:margin}}bottom:{{#var:b}}; |
'><!-- | '><!-- | ||
-->[[Bild:{{#var:img}}|{{#var:w}}|ohne|link=]]</div><!-- | -->[[Bild:{{#var:img}}|{{#var:w}}|ohne|link=]]</div><!-- |
Version vom 31. Mai 2020, 16:14 Uhr
Dia
Das Bild passt sich an die Größe des umgebenden DIV an. Standardmäßig ist eine div-Dimension von 1:2 angegeben (dies vor allem für Vorlage:Galerie).
Testbild:
Parameter:
{{DiaX.2 | uzume-hokusai.jpg | (text) | rw= [px] | rh= [px, auto] <!-- default= rw --> | top= | l= | r= | lr= | b= | style= (CSS) }}