Title: Two CSS in header
Last modified: May 24, 2019

---

# Two CSS in header

 *  Resolved [Fropky](https://wordpress.org/support/users/fropki/)
 * (@fropki)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/two-css-in-header/)
 * Hi,
 * I am getting two css in header. Second header only showing this
 * .g{margin:0;padding:0;overflow:hidden;line-height:1;zoom:1}.g img{height:auto}.
   g-col{position:relative;float:left}.g-col:first-child{margin-left:0}.g-col:last-
   child{margin-right:0}@media only screen and (max-width:480px){.g-col,.g-dyn,.
   g-single{width:100%;margin-left:0;margin-right:0}}
 * It is an inline CSS in without autoptimize version and we have enabled
 * Check this option for Autoptimize to also aggregate CSS in the HTML.
 * I was not able to find following code in my server except autoptimize file. Tried
   following command
 * [root@host wp-content]# grep -r “g-dyn” /home/username/example.com/
    /home/username/
   example.com/wp-content/cache/autoptimize/css/autoptimize_065892e82b11b7e2276dab07a3bdf8a3.
   css:.g{margin:0;padding:0;overflow:hidden;line-height:1;zoom:1}.g img{height:
   auto}.g-col{position:relative;float:left}.g-col:first-child{margin-left:0}.g-
   col:last-child{margin-right:0}@media only screen and (max-width:480px){.g-col,.
   g-dyn,.g-single{width:100%;margin-left:0;margin-right:0}}
 * I don’t how this file getting generated at all. Please help.
    -  This topic was modified 7 years, 3 months ago by [Fropky](https://wordpress.org/support/users/fropki/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ftwo-css-in-header%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/two-css-in-header/#post-11567651)
 * If you can share your site’s URL then I can probably tell you [@fropki](https://wordpress.org/support/users/fropki/)
   🙂
 *  Thread Starter [Fropky](https://wordpress.org/support/users/fropki/)
 * (@fropki)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/two-css-in-header/#post-11567675)
 * I got the code in adrotate pro plugin. How can I make it compatible with Autoptimize.
   So that only 1 CSS file is made.
 *  $output .= “<!– AdRotate CSS –>\n”;
    $output .= “<style type=\”text/css\” media
   =\”screen\”>\n”; $output .= “\t.g”.$adrotate_config[‘adblock_disguise’].” { margin:
   0px; padding:0px; overflow:hidden; line-height:1; zoom:1; }\n”; $output .= “\
   t.g”.$adrotate_config[‘adblock_disguise’].” img { height:auto; }\n”; $output .
   = “\t.g”.$adrotate_config[‘adblock_disguise’].”-col { position:relative; float:
   left; }\n”; $output .= “\t.g”.$adrotate_config[‘adblock_disguise’].”-col:first-
   child { margin-left: 0; }\n”; $output .= “\t.g”.$adrotate_config[‘adblock_disguise’].”-
   col:last-child { margin-right: 0; }\n”; foreach($generated_css as $group_id =
   > $css) { if(strlen($css) > 0) { $output .= $css; } } unset($generated_css); 
   $output .= “\t@media only screen and (max-width: 480px) {\n”; $output .= “\t\
   t.g”.$adrotate_config[‘adblock_disguise’].”-col, .g”.$adrotate_config[‘adblock_disguise’].”-
   dyn, .g”.$adrotate_config[‘adblock_disguise’].”-single { width:100%; margin-left:
   0; margin-right:0; }\n”; $output .= “\t}\n”; if($adrotate_config[‘widgetpadding’]
   == “Y”) { $output .= “.adrotate_widgets, .ajdg_bnnrwidgets, .ajdg_grpwidgets {
   overflow:hidden; padding:0; }\n”; } $output .= “</style>\n”; $output .= “<!– /
   AdRotate CSS –>\n\n”;
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/two-css-in-header/#post-11567677)
 * OK, origin is inline CSS which is not `media="all"` (or no media specified) but`
   media="screen"`. AO cannot (and should not) mix CSS of different media-attributes.
 * if this CSS is added by you, add it without a media-attribute or with media=”
   all” and it will be added to the other Autoptimized CSS-file.
 * hope this clarifies,
    frank
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/two-css-in-header/#post-11567691)
 * well, you could change
 * `$output .= “<style type=\”text/css\” media=\”screen\”>\n”;`
 * into
 * `$output .= “<style type=\”text/css\” media=\”all\”>\n”;`
 * but take into account that with any plugin update you would have to re-do that
   change 🙂
 *  Thread Starter [Fropky](https://wordpress.org/support/users/fropki/)
 * (@fropki)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/two-css-in-header/#post-11567692)
 * Thanks a lot 🙂
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/two-css-in-header/#post-11567713)
 * you’re welcome Fropky, feel free to [leave a review of the plugin and support here](https://wordpress.org/support/plugin/autoptimize/reviews/#new-post)!
   🙂

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

 The topic ‘Two CSS in header’ 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/)

 * 6 replies
 * 2 participants
 * Last reply from: [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * Last activity: [7 years, 3 months ago](https://wordpress.org/support/topic/two-css-in-header/#post-11567713)
 * Status: resolved