coding help

About

Fandom doesn't support adding background images the traditional way. This template offers a work-around.

Warning: Fragile code
Don't edit this template code unless you are familiar with complex code.
If not, don't let this stop you from learning! Visit your sandbox (User:<insert name here>/Sandbox), copy-paste the code, and tinker as much as you'd like.

Parameters

These parameters let you customize the results when you use the template. We have a lot of them!

Content:

CSS edits:

Examples

{{Background image
|width=380px
|heading=Finally, you can add background images!
|line1=Fandom code doesn't allow typical background images. But this code uses a work-around.
|line2=Enjoy!
}}
{{Background image
|width=380px
|opacity=1
|contentStyles=width: 300px; background-color: white; margin: auto;
|heading=You can change the CSS.
|line1=For example, now {{{contentStyles|}}} specifies a 300px white box. The background goes behind it.
|line2=This allows both readability and 100% background opacity.
}}

More info

Base code by MissLunaRose.

Customizable background image box

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
Box widthwidth

Width of the box, including your BG image. (default 400px)

Example
380px
Unknownsuggested
Box heightheight

Optional, should be no taller than the image height

Example
300px
Unknownsuggested
BG imageimage

The file name of your background image

Example
BG MissLunaRose Stars 1 Spring Purple.png
Filesuggested
BG image opacityopacity

Reduce opacity as needed for readability (default 0.5)

Example
0.75
Unknownsuggested
Background colorbgcolor

A background color for the entire box. (default white)

Example
LightCyan
Unknownsuggested
Text colortextColor

default black

Unknownsuggested
Outer div CSS stylesouterDivStyles

Any styles you want applied to the whole box

Example
font-family: Georgia, serif;
Unknownsuggested
Text area paddingpadding

Default 10px

Unknownsuggested
Text area CSS stylescontentStyles

Any styles you want for the text area

Example
text-align: center;
Unknownsuggested
Heading text (optional)heading

Add a heading to your box

Unknownsuggested
Heading CSS stylesheadingStyle

Special CSS styles for the heading

Example
color: MidnightBlue;
Unknownsuggested
Text line 1line1

Put content in here.

Example
I love CSS!
Unknownrequired
Text line 1 CSS stylesline1Style

Any CSS you want to apply to line 1

Example
font-size: 16px;
Unknownsuggested
Text line 2 (optional)line2

A convenient second paragraph

Example
I also love HTML!
Unknownsuggested
Text line 2 CSS stylesline2Style

Any CSS you want to apply to line 2

Example
font-size: 14px;
Unknownsuggested
Container CSS classesclass

Add special classes if needed (e.g. for link color control). Dark-links class is there by default but can be overridden

Suggested values
dark-links light-links
Unknownoptional