0

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

3 Answers 3

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
    Commented Nov 13, 2017 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.

-3

Add this in css file,

.block-search{

         float:left

         }
1
  • We have to do it using xml.
    – Zaid
    Commented Nov 10, 2017 at 6:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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