0

I want to move header logo to centre and top. Search bar to the left side of screen as per show in screen shoot how can I do this using default.xml file

enter image description here

1 Answer 1

1

Update your move tag using below code :

app/design/frontend/{{YOUR THEME NAME HERE}}/default/Magento_Theme/layout/default.xml

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<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" before="logo" />
    </body>  
</page>

Now, You need to update less code also :

.header.content {
    text-align: center;
    .block.block-search {
        float: left;
    }
    .logo {
        display: inline-block;
        float: none;
    }
    .minicart-wrapper {
        text-align: left;
    }
}

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.