0

I need to use custom css in IE.

Added below code to default_head_blocks.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
 <head>
 <css src="css/ie_styles.css" ie_condition="IE" />
 </head>
</page>

My magento version is 2.3.

I have written css in the ie_styles.css file which should load only in IE, but its not loading in my case when opened in IE.

Which is not loading in IE browser. Am i missing any other thing? I need to load separate css file only for IE browser.

Can anyone help me on this please.

Murtuza Zabuawala
14.8k10 gold badges47 silver badges76 bronze badges
asked Jul 17, 2019 at 8:43
3
  • Please check this magento.stackexchange.com/questions/121454/… Commented Jul 17, 2019 at 13:38
  • @AsheemPatro, I am not cleared with that link, before posting here i checked that link,I am not cleared with that.. Commented Jul 17, 2019 at 13:48
  • @jafarpinjar Can you check what this outputs in the DOM please? Based on github.com/magento/magento2/blob/… this should work. Commented Jul 18, 2019 at 8:32

1 Answer 1

0

Magento 2 no longer supports IE9 so this is unlikely to ever be fixed by Magento

It's looking very likely that this is down to the fact IE9 can only support up to 4096 selectors, my styles-m.css currently has 4977 selectors (due to having Luma as a parent (bad idea!)).

The styles inside the media-common mixin aren't displaying as they are placed last, after the 4096 limit.

It seems my only solution is to split the CSS up into multiple files, this should be fun!

answered Jul 18, 2019 at 10:59
1

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.