Title: iframe -&gt; amp-iframe css issue
Last modified: September 23, 2025

---

# iframe -> amp-iframe css issue

 *  Resolved [blackpearlyc8](https://wordpress.org/support/users/blackpearlyc8/)
 * (@blackpearlyc8)
 * [6 months, 3 weeks ago](https://wordpress.org/support/topic/iframe-amp-iframe-css-issue/)
 * I have a scenario where I am using the below CSS:
 *     ```wp-block-code
       div#check-iframe:has(iframe) 
       ```
   
 * I am adding this CSS in headers.php like below:
 *     ```wp-block-code
       <style amp-custom>    div#check-iframe:has(iframe) {        /* Your styles here */    }</style>
       ```
   
 * But using the AMP plugin, it is getting converted as below:
 *     ```wp-block-code
       div#check-iframe:has(amp-iframe)
       ```
   
 * I don’t want to convert my CSS from iframe to amp-iframe. Can anyone help me 
   to solve this ASAP?
    -  This topic was modified 6 months, 3 weeks ago by [blackpearlyc8](https://wordpress.org/support/users/blackpearlyc8/).

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

 *  Plugin Support [Milind More](https://wordpress.org/support/users/milindmore22/)
 * (@milindmore22)
 * [6 months, 2 weeks ago](https://wordpress.org/support/topic/iframe-amp-iframe-css-issue/#post-18661870)
 * Hello [@blackpearlyc8](https://wordpress.org/support/users/blackpearlyc8/)
 * Thank you for contacting us. The AMP plugin will transform your iframe tag into
   a web component amp-iframe. This conversion ensures that you have valid AMP pages
   with valid AMP tags.
 * However, if you want AMP-specific CSS, you can use
 *     ```
       html[amp] div#check-iframe:has(amp-iframe) {
            /* AMP specific CSS here */
       }
       ```
   
 * Please check our documentation about [AMP-specific CSS. ](https://amp-wp.org/documentation/how-the-plugin-works/amp-and-css/#adding-css-to-your-amp-urls)
 * We hope this helps!
 *  Plugin Support [Milind More](https://wordpress.org/support/users/milindmore22/)
 * (@milindmore22)
 * [6 months ago](https://wordpress.org/support/topic/iframe-amp-iframe-css-issue/#post-18676487)
 * [@blackpearlyc8](https://wordpress.org/support/users/blackpearlyc8/) As we didn’t
   receive a response I’ll mark this as resolved. Feel free to open a [new support topic](https://wordpress.org/support/plugin/amp/#new-post)
   if you require any further assistance.

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

The topic ‘iframe -> amp-iframe css issue’ 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: [Milind More](https://wordpress.org/support/users/milindmore22/)
 * Last activity: [6 months ago](https://wordpress.org/support/topic/iframe-amp-iframe-css-issue/#post-18676487)
 * Status: resolved