0

I have a megamenu in header and want to set the border bottom for the whole header and it should be aligned with the megamenu border but its not working as expected.

I have tried that into the following path:

vendor/magento/module-theme/view/frontend/templates/html/header.phtml

My requirement is to put the grey border to whole header and the border should be the same alignment with the border given in megamenu.

Any help will be appreciated!

0

you can enable template hints, and check it out by yourself. This is how you can know any phtml and blocks. Make sure your website is in developer mode to do this.

Go to Store > Configuration > Advanced > Developer > Debug

Change value to Yes of Enabled Template Path Hints for Storefront

  • I'm aware about that. The issue I'm facing now is something related to CSS. We have a megamenu in header. When we hover over the megamenu the border bottom will be displayed with color. Our requirement is to put the grey border to whole header and the border should be the same alignment with the border given in megamenu. – Siva Nov 21 at 11:36
  • you can directly write css in browser and check iif its works. Then simply add it in style.less in your custom theme or simply over ride template hint phtml and write some quick inline css. Either way it would work – Ali Hussain Nov 21 at 11:40
  • I can set the border but if I try to align with the megamenu border, its not working – Siva Nov 21 at 11:43
0

You can try with template hints as Ali said to know from which template it is loading. Or You can directly apply CSS based on the classes as shown in the below screenshot.

enter image description here

  • I have updated my question. Please look at it. – Siva Nov 21 at 11:41
  • Can you provide any screenshot – Venky Nov 21 at 11:45
0

Direct editing in the template file is not a good idea.

Please update your current theme CSS file and add the below code in your CSS file.

.page-header { border: 1px solid #000000;}

You can add color code accordingly.

  • I have tried that. But the border should be same align as the mega menu in header. However, if I try with margin-top, the whole header is moving top – Siva Nov 21 at 11:42
  • Share the website URL So I can check the CSS – Madhu Rajawat Nov 21 at 11:53
  • Share the screenshot so I can give you the solution – Madhu Rajawat Nov 21 at 13:08

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.