Today we are going to discuss that how to add third-party js and CSS in our Magento 2 via layout XML.
We have to add CSS and JS in layout via layout.
The syntax for CSS in layout
<head> <css src="https://cloudflare.com/assets/owl.carousel.css" src_type="url" /> </head>
The syntax for JS in layout
<head> <script src="https://cloudflare.com/assets/owl.carousel.js" src_type="url" /> </head>
as per above, we can add this in our layout file
That’s it.