hello guys i am trying to use owl carousel in phtml file in console it shows error regarding css Following is my default_head_block.xml file which is a layout file
<?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>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<css src="web/css/owl.carousel.css" />
<css src="web/css/owl.theme.css" />
</head>
</page>
Following is my default.xml file through i am calling phtml file
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="content">
<block class="Magento\Framework\View\Element\Template" name="slider_test" template="Magento_Theme::slider.phtml" after="-" />
</referenceContainer>
<referenceBlock name="logo">
<arguments>
<argument name="logo_img_width" xsi:type="number">148</argument>
<argument name="logo_img_height" xsi:type="number">43</argument>
</arguments>
</referenceBlock>
</body>
</page>
Following is my slider.phtml file in which i am calling owl carousel
<div class="owl-carousel" id="car">
<div> Your Content </div>
<div> Your Content </div>
<div> Your Content </div>
<div> Your Content </div>
<div> Your Content </div>
<div> Your Content </div>
<div> Your Content </div>
</div>
<script type="text/javascript">
require([
'jquery',
'owlcarouselslider'
], function ($) {
$("#car").owlCarousel();
});
</script>
following is error which showing in console