How i can add the custom style to perticular pag in magento like :
I want to know how we can add style tag in page editor
Click on Show/Hide editor and you will be able to edit HTML source directly so you can add a style
tag there
@Max unfortunatelly, tinyMCE will convert style
tags to html comments. And after each modification of CMS page you should take care of replacing html comments back to style
tags - this is not very good approach.
So, my suggestion is to use specific CMS page class name, that is being added to body
tag. You can go to your CMS page, and take a look at source code of the page to find this class name.
You can add your custom stylesheet for cms page. just do this in your cms page open design tab and in layout update xml field just add this code
<reference name="head">
<action method="addCss">
<stylesheet>css/your.css</stylesheet>
</action>
</reference>
Hope this will help you
Since adding <style> tag directly is not working, you can use javascript instead. If youe theme is using jQuery, you may do it this way (concat the style tag so editor will not mark it as comment):
jQuery('body').append('<sty'+'le>'+'#header{margin:10px 0 0 0;}#morestylehere{display:inline}'+'</sty'+'le>')
Make sure it's enclosed with <script> tags.
So ran into this same issue, I needed it to allow the customer to adjust a few values with a media query depending on the edits of the content.
Simply place empty comments at the start and end of your style and TinyMCE will not add it's own.
e.g.:
<style type="text/css" scoped><!-- -->
p{color:red;}
<!-- --></style>
This is valid at least with Magento v1.9.1