I am developing an chat application. The message display is all html, so html tags work for text formatting. I would like it if tags like <red></red> etc. would change the text color. Is there anyway to define new tags like that, or will I just have to replace the fake tags with actual html?
I am developing an chat application. The message display is all html, so html
Share
In all modern browsers you can use your own tags in a literal sense (however note that its not valid HTML/XHTML markup):
Then in CSS:
However in IE8 and below you will need to use some JavaScript to allow Internet Explorer to style ‘made-up’ tags (in the same way that you active the new HTML5 tags such as
article,section, etc.Here is a JSFiddle illustrating the above.