I want to change the position of the mini cart in my theme. i am able to change it using css but it disturbs the mobile view. So is there any way i can do it using xml
2 Answers
Just you need to put the bellow code to your theme default.xml file
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
--------------------
<move element="minicart" destination="header.panel" after="top.search" />
--------------------
</body>
</page>
This your file path
design/frontend/YourTheme/ThemeName/Magento_Theme/layout/default.xml
you can change in layout file and interchange the position by using tag:
<move element="minicart" destination="header.container" before="-" />
Please, refer official link for more clarity : http://devdocs.magento.com/guides/v2.1/frontend-dev-guide/layouts/layout-types.html