MyBB Community Forums

Full Version: How to make own tag like <sunjava>
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
How do I make my own tag and use it in html, I searched and found it can be done through xml, can anyone tell me complete procedure of doing this ?
what i want is:

style.css
sunjava{
background:red;
border:1px solid green;
}

html file


<html>
<link href="style.css">

<sunjava> Hi this is me </sunjava>
</html>
XML!=(X)HTML

What you can do is create a class and use a span tag though.
I don't want to use classes, this is the real problem, as mybb have custom mybb codes there might be a way
Any specific reason you want to do this? Honestly there's no point. Just use classes. That's what they're there for.
You aren't supposed to do it that way, it's done like this:

<span class='sunjava'>U SEE?</span>

In theory, you could do custom tags with a massive str_replace() in PHP but that's utterly pointless.

Edit: WHY don't you want to use classes? The point of tags is semantics.
I want to learn, I know its very simple with classes, but learning has no reason Wink
There is nothing to learn there though. You're asking to do not only a pointless thing but an impossible one.

The only way to create a new tag is write a browser (but it then will only work in your browser).
If you insist, the code you have in your first post should work, at least it did for FF2. Toungue
Why it's impossible ? mybb codes is an example of it,
You can write

[sunjava]test[/sunjava]


result might be:
test
bbcode isn't html though. It's converted into standard html when you submit the post.
Pages: 1 2