模板:Background:修订间差异
来自Blockland Wiki
更多操作
无编辑摘要 |
无编辑摘要 |
||
| 第1行: | 第1行: | ||
<includeonly>< | <includeonly><html><style> | ||
body::before { | |||
content: "" !important; | |||
position: fixed !important; | |||
inset: 0 !important; | |||
z-index: -1 !important; | |||
pointer-events: none !important; | |||
background-image: url({{{image}}}) !important; | |||
background-size: {{{size|cover}}} !important; | |||
background-position: {{{position|center}}} !important; | |||
background-repeat: {{{repeat|no-repeat}}} !important; | |||
{{#if:{{{color|}}}|background-color: {{{color}}} !important;}} | |||
{{#if:{{{opacity|}}}|opacity: {{{opacity}}} !important;}} | |||
} | |||
</style></html></includeonly><noinclude> | |||
<nowiki> | <nowiki> | ||
; 用法 | ; 用法 | ||
: {{Background|image=图片URL|opacity=透明度}} | : {{Background|image=图片URL|color=背景色|opacity=透明度}} | ||
; 示例 | ; 示例 | ||
: {{Background|image=https://example.com/bg.jpg}} | : {{Background|image=https://example.com/bg.jpg}} | ||
: {{Background|image=https://example.com/bg.jpg|opacity=0.3}} | : {{Background|image=https://example.com/bg.jpg|opacity=0.3}} | ||
: {{Background|image=https://example.com/bg.jpg|color=#0d1117|opacity=0.5}} | |||
; 参数 | ; 参数 | ||
: image — 背景图片URL(必填) | : image — 背景图片URL(必填) | ||
: opacity — 透明度 0~ | : color — 背景颜色(可选) | ||
: size — 图片尺寸,默认 cover | |||
: position — 图片位置,默认 center | |||
: repeat — 是否重复,默认 no-repeat | |||
: opacity — 透明度 0~1(可选) | |||
</nowiki> | </nowiki> | ||
</noinclude> | </noinclude> | ||
2026年5月12日 (二) 21:02的版本
; 用法 : {{Background|image=图片URL|color=背景色|opacity=透明度}} ; 示例 : {{Background|image=https://example.com/bg.jpg}} : {{Background|image=https://example.com/bg.jpg|opacity=0.3}} : {{Background|image=https://example.com/bg.jpg|color=#0d1117|opacity=0.5}} ; 参数 : image — 背景图片URL(必填) : color — 背景颜色(可选) : size — 图片尺寸,默认 cover : position — 图片位置,默认 center : repeat — 是否重复,默认 no-repeat : opacity — 透明度 0~1(可选)