Back to Top

Add External Css And JS in Magento2

Updated 11 April 2017

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>

Searching for an experienced
Magento 2 Company ?
Find out More
. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


Be the first to comment.

Back to Top

Message Sent!

If you have more details or questions, you can reply to the received confirmation email.

Back to Home