MyBB Community Forums

Full Version: CSS MyCode?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Is there a mycode so that you can type in a CSS element and it will show what it actually looks like type thing?
You could probably just create a MyCode that makes a span or div tag with a style attribute.

For example the find would be:
[span style="css-property: xyz;"]Test[/span]

Replace with:
<span style="css-property: xyz;">Test</span>

You would obviously need to work out the regular expression to go achieve this.
I have no Idea how to do that Confused
Regular Expression:
\[span style=(.*?)\](.*?)\[/span\]

Replacement:
<span style="$1">$2</span>
No, the Regular expression is:
\[span style\=(.*?)](.*?)\[/span\]

Edit:
Blah, placed the \ in the wrong spot, sorry, fixed.
You need to escape the ], not the (
Then why does this work?
\[pop\=(.*?)](.*?)\[/pop\]
Why would you escape the opening [ and closing [ and ], but not the opening ]?? That doesn't seem logical.
Because when I go looking through MyCode plugins, which is how I found out how they worked, that's how they did it.
Pages: 1 2