Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Background image/color
#1
Here are two MyCodes I just came up with.

One is to add a background color to text, the other is to add a background image to text.

Background Color
Name:
Code:
Background Color

Regular Expression:
Code:
\[bg=(.*?)\](.*?)\[/bg\]

Replacement:
Code:
<span style="background-color: $1;">$2</span>

Output:
   

Background Image
Name:
Code:
Background Image

Regular Expression:
Code:
\[bg color=(.*?) image=(.*?) position=(.*?) (.*?) repeat=(.*?) padding=(.*?)\](.*?)\[/bg\]

Replacement:
Code:
<span style="background: $1 url($2) $3 $4 repeat-$5;padding: $6;">$7</span>

Output:
   
Reply
#2
Nice. Thanks.
<snip - "too big"> despite many sigs on here being much larger and approved - sort it out instead of removing sigs without warning
Reply
#3
Cool but I won't be using it Toungue.
Reply
#4
Lol, whats the point of having an image and a color?
GooglePlus - Circle me! | Twitter - My random tweets.| YouTube - My semi-funnish videos.
Reply
#5
Like if I used the thead image, it would just keep repeating itself. So you can set a background color with it and make it just repeat x direction and it would be like the regular .thead.
Reply
#6
Dam i made this but its all in one Sad
Only if i knew it already existed =\
Reply
#7
Nice one Joshee,very useful Smile.
Btw can u add a option for text-color using the first example?
background-color + text-color.
Thx in advanced.
Reply
#8
Code:
\[bg=(.*?) color=(."?)\](.*?)\[/bg\]
Code:
<span style="background-color: $1;color: $2;">$3</span>

Should work.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)