WordPress stripping < style > tags from document
The WordPress tinymce stripe out some tag inlcuding style tag. You can add support for style tag.
Add the following code in functions.php
————————————
add_filter('tiny_mce_before_init', 'prefix_filter_tiny_mce_before_init'); function prefix_filter_tiny_mce_before_init( $options ) { if ( ! isset( $options['extended_valid_elements'] ) ) { $options['extended_valid_elements'] = 'style'; } else { $options['extended_valid_elements'] .= ',style'; } if ( ! isset( $options['valid_children'] ) ) { $options['valid_children'] = '+body[style]'; } else { $options['valid_children'] .= ',+body[style]'; } if ( ! isset( $options['custom_elements'] ) ) { $options['custom_elements'] = 'style'; } else { $options['custom_elements'] .= ',style'; } return $options; }
Source :- https://stackoverflow.com/questions/40825127/wordpress-stripping-style-tags-from-document