Here we will see how to add external css and js file in magento2.
Add External Css In Magento2
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<css src="http://externalcss/external.css" src_type="url"/>
</head>
</page>
Add External Js In Magento2
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<script src="http://externaljs/external.js" src_type="url"/>
</head>
</page>
Be the first to comment.