模板:Background:修订间差异
来自Blockland Wiki
更多操作
无编辑摘要 |
无编辑摘要 |
||
| 第1行: | 第1行: | ||
<includeonly>< | <includeonly><style> | ||
body { | |||
{{#if:{{{image|}}} | {{#if:{{{image|}}} | ||
|background-image: url({{{image}}}); | |background-image: url({{{image}}}) !important; | ||
background-size: {{{size|cover}}}; | background-size: {{{size|cover}}} !important; | ||
background-position: {{{position|center}}}; | background-position: {{{position|center}}} !important; | ||
background-repeat: {{{repeat|no-repeat}}}; | background-repeat: {{{repeat|no-repeat}}} !important; | ||
}} | }} | ||
{{#if:{{{color|}}} | {{#if:{{{color|}}} | ||
|background-color: {{{color}}}; | |background-color: {{{color}}} !important; | ||
}} | }} | ||
{{#if:{{{opacity|}}} | {{#if:{{{opacity|}}} | ||
| | |background-blend-mode: multiply !important; | ||
background-color: rgba(0,0,0,{{{opacity}}}) !important; | |||
}} | }} | ||
} | |||
</style></includeonly><noinclude> | |||
<nowiki> | <nowiki> | ||
; 用法 | ; 用法 | ||
: {{Background|image=图片URL|color=背景色|opacity=透明度}} | : {{Background|image=图片URL|color=背景色|opacity=透明度}} | ||
; | ; 背景图片(跟随深浅色) | ||
: {{Background|image=https://example.com/bg.jpg}} | : {{Background|image=https://example.com/bg.jpg}} | ||
; | ; 背景图片 + 半透明遮罩 | ||
: {{Background|color=#0d1117}} | : {{Background|image=https://example.com/bg.jpg|opacity=0.3}} | ||
; 背景图片 + 自定义底色 | |||
: {{Background|image=https://example.com/bg.jpg|color=#0d1117}} | |||
; 参数 | ; 参数 | ||
: image — 背景图片URL | : image — 背景图片URL | ||
: color — | : color — 背景颜色(可选,不填则用 Citizen 深浅色) | ||
: size — 图片尺寸,默认 cover | : size — 图片尺寸,默认 cover | ||
: position — 图片位置,默认 center | : position — 图片位置,默认 center | ||
: repeat — 是否重复,默认 no-repeat | : repeat — 是否重复,默认 no-repeat | ||
: opacity — | : opacity — 半透明遮罩 0~1(可选) | ||
</nowiki> | </nowiki> | ||
</noinclude> | </noinclude> | ||
2026年5月12日 (二) 20:51的版本
; 用法 : {{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}} ; 参数 : image — 背景图片URL : color — 背景颜色(可选,不填则用 Citizen 深浅色) : size — 图片尺寸,默认 cover : position — 图片位置,默认 center : repeat — 是否重复,默认 no-repeat : opacity — 半透明遮罩 0~1(可选)