Title: exclude a &quot;common&quot; inline css code for a specific css file
Last modified: August 22, 2016

---

# exclude a "common" inline css code for a specific css file

 *  [roscus79](https://wordpress.org/support/users/roscus79/)
 * (@roscus79)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/exclude-a-common-inline-css-code-for-a-specific-css-file/)
 * Good Day!
    I have a question: Is it possible exclude an inline css code for a
   specific css file? I have on my website a common css string called “media” that
   i want to exclude in the style.css file… but this string is used also in a lot
   of other css files. If I write “media” in the form for exclude css, then autoptimize
   exclude all the css file that have the string media inside… but I want exclude
   media only for the style.css. My question is: Is there a way to specific from
   which file i can exclude the specific string? i don’t know Style.css?media or
   [media@style.css](https://wordpress.org/support/topic/exclude-a-common-inline-css-code-for-a-specific-css-file/media@style.css?output_format=md)
 * let me know, thank you!
    Regards Rosario
 * [https://wordpress.org/plugins/autoptimize/](https://wordpress.org/plugins/autoptimize/)

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

 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/exclude-a-common-inline-css-code-for-a-specific-css-file/#post-5296596)
 * hmmm, I would try to be a bit more specific; assuming for example your inline
   code is something like;
 *     ```
       @media (max-width: 600px) {
         .facet_sidebar {
           display: none;
         }
       }
       ```
   
 * you could try to exclude with “@media” or “@media (max-width: 600px)”?
 *  Thread Starter [roscus79](https://wordpress.org/support/users/roscus79/)
 * (@roscus79)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/exclude-a-common-inline-css-code-for-a-specific-css-file/#post-5296602)
 * [ cusenzamarmi](http://www.cusenzamarmi.com/) in homepage the 3 banners under
   the slider are broken (and also in contatti page the icons are not well shown)
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/exclude-a-common-inline-css-code-for-a-specific-css-file/#post-5296614)
 * sorry, afraid you lost me there; are you still talking about the CSS exclusions,
   or is that a separate question?
 *  Thread Starter [roscus79](https://wordpress.org/support/users/roscus79/)
 * (@roscus79)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/exclude-a-common-inline-css-code-for-a-specific-css-file/#post-5296619)
 * always css exclusions… I posted my website for show the problem that i have… 
   you can see the source and search for #banner0 or #banner1 or #banner2 and see
   [@media](https://wordpress.org/support/users/media/)
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/exclude-a-common-inline-css-code-for-a-specific-css-file/#post-5296695)
 * OK, had a look and the problem is that you (probably) excluded bootstrap.css 
   from optimization. This means that, whereas without optimization your style.css
   is loaded after bootstrap.css, now the optimized CSS that contains the style.
   css code is loaded before bootstrap.
 * There are several possible solutions to this problem;
    - mark the appropriate rules in your style.css as !important, e.g.
    -     ```
          .input-prepend .add-on {
            background: none repeat scroll 0% 0% transparent !important;
            border: 0px none !important;
          }
          ```
      
    - do not exclude bootstrap.css from optimization (but you might have had other
      reasons for doing so)
    - change the place where the optimized style is inserted, using the API, by 
      using (in your child theme’s functions.php) e.g.;
    -     ```
          add_filter('autoptimize_filter_css_replacetag','roscus_ao_override_css_replacetag',10,1);
          function roscus_ao_override_css_replacetag($replacetag) {
          	return array("</head>","before");
          	}
          ```
      
 * Hope this helps,
    frank

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

The topic ‘exclude a "common" inline css code for a specific css file’ is closed
to new replies.

 * ![](https://ps.w.org/autoptimize/assets/icon-256X256.png?rev=2211608)
 * [Autoptimize](https://wordpress.org/plugins/autoptimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/autoptimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/autoptimize/)
 * [Active Topics](https://wordpress.org/support/plugin/autoptimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/autoptimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/autoptimize/reviews/)

## Tags

 * [exclude](https://wordpress.org/support/topic-tag/exclude/)
 * [inline css](https://wordpress.org/support/topic-tag/inline-css/)

 * 5 replies
 * 2 participants
 * Last reply from: [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * Last activity: [11 years, 8 months ago](https://wordpress.org/support/topic/exclude-a-common-inline-css-code-for-a-specific-css-file/#post-5296695)
 * Status: not resolved