0

I want to move the search bar from right to the center of the homepage using xml.enter image description here

0
 <move element="block.search" destination="header-wrapper" after="logo" />

We have to add this in default.xml file

and then change the css accordingly, after that it will work fine.

1
  • <move element="block.search" destination="header-wrapper" after="logo" />
    – Zaid
    Nov 13 '17 at 4:53
0

If you're using magento2.3 then the correct file path is given below.

app/design/frontend/Vendor_Name/Theme_Name/Magento_Theme/layout/default.xml

<?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">
<body>
         <move element="top.search" destination="header-wrapper" after="logo" />
</body>
</page>

And don't forget to flush magento cache.

0

by adding this I didn't get an answer in my Magento so please help.. how to find element and destination in Magento 2.3.5

-3

Add this in css file,

.block-search{

         float:left

         }
1
  • We have to do it using xml.
    – Zaid
    Nov 10 '17 at 6:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.