0

Hello I am trying to deferring following CSS using <params>defer="defer"</params> tag but it is not working. Here is my style sheet which I want to defer:

<action method="addItem"><type>skin_css</type><name>css/infortis/ultra-megamenu/ultra-megamenu.css</name><params>defer="defer"</params></action>

The tool which I am using to check is: https://developers.google.com/speed/pagespeed/insights/?url=

So please let me know the correct way to defer the CSS. However my JS are successfully deferring and asyncing.

Thanks

1 Answer 1

0

Defer is a boolean attribute which must be used only for external scripts provided if src attribute is present

<script src="name.js" defer></script>

I don't think so you can defer CSS using defer attribute.

Try using rel="preload"

  <link rel="preload" href="style.css" as="style">
2
  • So how it could be achieved in magento 1.9?
    – Stack user
    Jul 30, 2019 at 12:32
  • try rel="preload" check in all browsers which fastens up loading time of css Jul 30, 2019 at 13:13

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.