Magic of WordPress

WordPress is having magic hidden behind it. Few magics are related to <script> and <style> tags. Today I have tried both style and script tag. I was aware of problem in style or script but did not remember where it is.

When I have entered <style> tag with some styles mentioned, it became like this when I switched from HTML editor to  Visual editor and back.

<style> .quotes{color:red} </style> => <!--.quotes{color:red} -->

So, it did not allow style tag in post but it preserved the content, so that my hard work does not go waste.

After seeing this I thought it may be <script> tag that is accepted. So, just for checking I have entered script tag, with no content and it became like this when seen in .

<script></script> => <script type="text/javascript"></script>.

When I entered content to script tag then it worked like this:

<script type="text/javascript">document.write("<"+"style" + ">" + '.quotes{color:red}' + '</'+'style>');</script>


<script type="text/javascript">// <![CDATA[
document.write("<"+"style" + ">" + '.quotes{color:red}' + '</'+'style>');
// ]]></script>

So, above I have showed you, how to enter your style with post content, when you do not want to add style in common/default stylesheet. I just created a page for quotes and for that I need a style tag only for this page. So thought not to modify common stylesheet.