Title: ie.css
Last modified: May 30, 2021

---

# ie.css

 *  Resolved [stevebrett](https://wordpress.org/support/users/stevebrett/)
 * (@stevebrett)
 * [4 years, 12 months ago](https://wordpress.org/support/topic/ie-css/)
 * Im having an issue where rules in ie.css randomly and seemingly unpredictably
   change the way pages on thiis site render. And i dont understand its role. Presumable
   ie is for internet explorere but im reviewing the site in fire fox and chrome.
 * Here the specific current issue on the page referenced above
 * H2.entry titles are dark grey (they should be #fff) when i inspect them i see
   the color is triggered by this rule in line 11259 of ie.css
    `.entry-title { 
   color: #28303d; font-size: 2.25rem; letter-spacing: normal; line-height: 1.3;
   overflow-wrap: break-word; }
 * Ive made a exact copy of the site and this page at
 * [https://walkercreekmedia.com/dev/category/short-docs/](https://walkercreekmedia.com/dev/category/short-docs/)
 * If you look on this page the h2.entry-titles are #fff as expected and the color
   set by line 4054 in style.css as expected
 * .entry-title {
    color: var(–entry-header–color);
 * I’m pulling my hair out trying to figure out why ie.css overrides (only occasionally)
   style.css. I could write a rule in the customizer and that would take care of
   this particular issue and the site will look ok for a week or so and then this
   issue will appear on another element someplace else.
 * Its vexing. Any thoughts
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fie-css%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  [Oliver Campion](https://wordpress.org/support/users/domainsupport/)
 * (@domainsupport)
 * [4 years, 12 months ago](https://wordpress.org/support/topic/ie-css/#post-14503310)
 * Hello,
 * ie.css is only loaded when the [`$is_IE` WordPress Global Variable](https://codex.wordpress.org/Global_Variables)
   is `true` …
 *     ```
       global $is_IE, $wp_scripts;
       	if ( $is_IE ) {
       		// If IE 11 or below, use a flattened stylesheet with static values replacing CSS Variables.
       		wp_enqueue_style( 'twenty-twenty-one-style', get_template_directory_uri() . '/assets/css/ie.css', array(), wp_get_theme()->get( 'Version' ) );
       	} else {
       		// If not IE, use the standard stylesheet.
       		wp_enqueue_style( 'twenty-twenty-one-style', get_template_directory_uri() . '/style.css', array(), wp_get_theme()->get( 'Version' ) );
       	}
       ```
   
 * This variable is set in vars.php of WordPress core as follows …
 *     ```
               if ( ( strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE' ) !== false || strpos( $_SERVER['HTTP_USER_AGENT'], 'Trident' ) !== false ) && strpos( $_SERVER['HTTP_USER_AGENT'], 'Win' ) !== false ) {
       		$is_winIE = true;
       	} elseif ( strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE' ) !== false && strpos( $_SERVER['HTTP_USER_AGENT'], 'Mac' ) !== false ) {
       		$is_macIE = true;
               }
       ```
   
 * As you can see above, because the variable is only set to true when the user’s
   browser agent contains MSIE, it’s highly unlikely that using Firefox would allow
   this to happen.
 * ie.css is used to make sure that the theme is compatible (to a fashion) with 
   Internet Explorer which isn’t compatible with the `var()` CSS function used throughout
   the theme’s CSS.
 * So … it’s more likely that something is messing with the `$is_IE` global variable
   on your site. Perhaps another plugin?
 * Or perhaps you’ve changed the Twenty Twenty-One theme … ? Have you tried with
   a fresh copy of Twenty Twenty-One?
 * Oliver
 *  Thread Starter [stevebrett](https://wordpress.org/support/users/stevebrett/)
 * (@stevebrett)
 * [4 years, 12 months ago](https://wordpress.org/support/topic/ie-css/#post-14504748)
 * Thanks for that explanation. We haven’t edited the theme. None the less i’ve 
   installed a fresh copy and we’ll see how that goes. Given the irregularity of
   it all it might be a week before we see it happen
 * I notice
    function twentytwentyone_add_ie_class()
 * in functions.php on a page i was looking at before i freshened up the theme that
   had loaded styles from ie.css i didnt see the is_IE body class.
 * Also could you hazzard a guess as to what type of plugin might do this. I just
   looked at this list and nothing jumped out at me
 * Thanks so much Oliver
 *  [Oliver Campion](https://wordpress.org/support/users/domainsupport/)
 * (@domainsupport)
 * [4 years, 12 months ago](https://wordpress.org/support/topic/ie-css/#post-14505598)
 * > I notice function twentytwentyone_add_ie_class() in functions.php
 * That just injects the class is-IE into the body element of the HTML if the JavaScript
   recognises the user-agent of the browser as containing MSIE.
 * Just looked at your site though and not seeing ie.css being loaded anymore so
   looks like you sorted it.
 * Oliver
 *  Thread Starter [stevebrett](https://wordpress.org/support/users/stevebrett/)
 * (@stevebrett)
 * [4 years, 12 months ago](https://wordpress.org/support/topic/ie-css/#post-14507098)
 * Thanks again Oliver well keep an eye onit but that’s the frustrating thing it
   just seems to randomly load- But perhaps reinstalling the theme sorted it
 *  Thread Starter [stevebrett](https://wordpress.org/support/users/stevebrett/)
 * (@stevebrett)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/ie-css/#post-14513530)
 * Oliver could you take another peek. right now the primary menu has the ie styles
   but not on every page
 * Most are ok, but not here for example
 * [https://www.walkercreekmedia.com/gloucesterprints/](https://www.walkercreekmedia.com/gloucesterprints/)
 *  [Oliver Campion](https://wordpress.org/support/users/domainsupport/)
 * (@domainsupport)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/ie-css/#post-14516551)
 * Hello,
 * I can confirm that your site is loading ie.css on Safari.
 * Very odd indeed.
 * All I can suggest is that you disable all plugins and see which one is causing
   this issue by turning them back on one-by-one. Obviously make sure you run a 
   full backup before doing this.
 * I can think of no reason why an unmodified WordPress core or parent theme would
   cause this behaviour.
 * Sorry.
 * Oliver
 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/ie-css/#post-14517383)
 * Are you using any sort of caching plugin, or do you see a “Clear/Purge Cache”
   button in your Dashboard or admin bar? If so, would you please try clearing the
   cache?
 * Note: You do not need to install a caching plugin at this point just to clear
   a cache you don’t have. If you don’t have a caching plugin or a way to clear 
   a server-level cache, just say so. 🙂
 *  Thread Starter [stevebrett](https://wordpress.org/support/users/stevebrett/)
 * (@stevebrett)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/ie-css/#post-14517562)
 * Yes we are James and if I clear the cache it will and did fix this issue- but
   it or perhaps another one related to ie.css will reappear eventually
 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/ie-css/#post-14517585)
 * Ok, that sounds right then. So, someone with IE visits the site, and that gets
   cached.
 * Your caching system shouldn’t be caching variables like that though.
 * What caching plugin are you using?
 *  Thread Starter [stevebrett](https://wordpress.org/support/users/stevebrett/)
 * (@stevebrett)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/ie-css/#post-14517627)
 * James thanks- were using the lightspeed cache
 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/ie-css/#post-14517656)
 * In that case, I recommend reporting the problem at [https://wordpress.org/support/plugin/litespeed-cache/](https://wordpress.org/support/plugin/litespeed-cache/)
   so the plugin’s developers and support community can help you with this.
 *  Thread Starter [stevebrett](https://wordpress.org/support/users/stevebrett/)
 * (@stevebrett)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/ie-css/#post-14517902)
 * Thanks James will do
 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/ie-css/#post-14518209)
 * You’re welcome!
 * Just noting here that’s over at [https://wordpress.org/support/topic/light-speed-is-incorectly-caching-ie-css-from-2021-theme/](https://wordpress.org/support/topic/light-speed-is-incorectly-caching-ie-css-from-2021-theme/)

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

The topic ‘ie.css’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/twentytwentyone/2.8/screenshot.
   png)
 * Twenty Twenty-One
 * [Support Threads](https://wordpress.org/support/theme/twentytwentyone/)
 * [Active Topics](https://wordpress.org/support/theme/twentytwentyone/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/twentytwentyone/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/twentytwentyone/reviews/)

 * 13 replies
 * 3 participants
 * Last reply from: [James Huff](https://wordpress.org/support/users/macmanx/)
 * Last activity: [4 years, 11 months ago](https://wordpress.org/support/topic/ie-css/#post-14518209)
 * Status: resolved