Title: Css Not valid
Last modified: May 28, 2018

---

# Css Not valid

 *  Resolved [miriazab](https://wordpress.org/support/users/miriazab/)
 * (@miriazab)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/css-not-valid/)
 * Hi,
 * A few days ago I see on the Search Console that there is a syntax error in the
   AMP style sheets. I haven’t touched any plugin file and I can’t find in which
   file is the error. Can you please tell me how to fix it?
 * thanks
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcss-not-valid%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Ryan Kienstra](https://wordpress.org/support/users/ryankienstra/)
 * (@ryankienstra)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/css-not-valid/#post-10333756)
 * Hi [@miriazab](https://wordpress.org/support/users/miriazab/),
    Thanks for letting
   me know about those issues. I also saw them:
 * 1. Custom JavaScript is not allowed.
    2. CSS syntax error in tag ‘style amp-custom’–
   unterminated comment. [https://validator.ampproject.org/#url=https%3A%2F%2Fwww.adelgazarsinmilagros.com%2Flistado-de-alimentos-y-snacks-low-carb%2Famp%2F](https://validator.ampproject.org/#url=https%3A%2F%2Fwww.adelgazarsinmilagros.com%2Flistado-de-alimentos-y-snacks-low-carb%2Famp%2F)
   [⌊Validation errors⌉](https://cloudup.com/cwKJUBPVneK)
 * 1. Do you have any other plugin related to AMP, SSL or HTTPS? Some plugin is 
   outputting this `<script>`, which isn’t allowed in AMP:
 * `<script>if (document.location.protocol != "https:") {document.location = document.
   URL.replace(/^http:/i, "https:");}</script>`
 * Even in non-AMP, it’s usually not a best practice to have inline `<script>` tags
   in the `<head>`.
 * 2. The CSS looks to be coming from this line in the Yuzo Related Post plugin:
   
   [https://plugins.trac.wordpress.org/browser/yuzo-related-post/trunk/yuzo_related_post.php#L975](https://plugins.trac.wordpress.org/browser/yuzo-related-post/trunk/yuzo_related_post.php#L975)
 * Disabling that plugin would probably take care of that issue, though you’re probably
   using that plugin for a reason 🙂
 * But that HTML is still valid (if unusual), and this AMP plugin isn’t handling
   commented-out inline styles properly.
 * This looks to be fixed in the upcoming [1.0 release](https://github.com/Automattic/amp-wp/tree/2fb93977984fb128391970325bcda4cf73d4f8fd)
   of this plugin. There’ll probably be at least a Beta version in June.
 * **Background**
    For this markup:
 *     ```
       <div class="yuzo-img-wrap " style="/*width: 126.5px;height:88px;*/">
       ```
   
 * The style rule in AMP doesn’t have a closing comment: `*/`
 *     ```
       .amp-wp-inline-a386c318dfa5afbad39334c530575875{/*width:126.5px;height:88px;}
       ```
   
    -  This reply was modified 7 years, 11 months ago by [Ryan Kienstra](https://wordpress.org/support/users/ryankienstra/).
 *  [Ryan Kienstra](https://wordpress.org/support/users/ryankienstra/)
 * (@ryankienstra)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/css-not-valid/#post-10333930)
 * **JavaScript Issue**
 * Hi [@miriazab](https://wordpress.org/support/users/miriazab/),
    Could you please
   try this code in your theme’s `functions.php` or in a plugin? It looks like the
   Really Simple SSL plugin is outputting that script. Thanks to [@zelldi](https://wordpress.org/support/users/zelldi/)
   for pointing that out on another topic.
 * This blocks the script on AMP endpoints only:
 *     ```
       /**
        * Prevents outputting an illegal <script> if this is an AMP endpoint.
        *
        * @param string $script The <script>
        * @return string $script The unchanged <script>, or an empty string if this is on an AMP endpoint.
        */
       add_filter( 'rsssl_javascript_redirect', function( $script ) {
       	if ( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ) {
       		return '';
       	}
       	return $script;
       } );
       ```
   
 * [https://www.adelgazarsinmilagros.com/wp-content/plugins/really-simple-ssl/readme.txt](https://www.adelgazarsinmilagros.com/wp-content/plugins/really-simple-ssl/readme.txt)

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Css Not valid’ is closed to new replies.

 * ![](https://ps.w.org/amp/assets/icon.svg?rev=2527602)
 * [AMP](https://wordpress.org/plugins/amp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/amp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/amp/)
 * [Active Topics](https://wordpress.org/support/plugin/amp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/amp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/amp/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Ryan Kienstra](https://wordpress.org/support/users/ryankienstra/)
 * Last activity: [7 years, 11 months ago](https://wordpress.org/support/topic/css-not-valid/#post-10333930)
 * Status: resolved