Tuesday, August 23, 2022

[FIXED] how to apply a custom css class on a magento 2 customer forget password page

Issue

i want to apply some css for a customer forget password page only like for title. if i apply any css then it reflects on all pages but i want to apply only on a single page. can some one guide pls? I am using m2.3.5p1 thanks


Solution

The easiest way to achieve this is to look at the <body> of the specific page you want to modify. Every page's <body> has a unique class you can root your css selector to.

In case of the forgot password page, the body's class is customer-account-forgotpassword. So, in case of the page title, just add

body.customer-account-forgotpassword h1{
//yourstyle
}

to your _extend.less or wherever you manage your css.



Answered By - Tobi
Answer Checked By - Cary Denson (PHPFixing Admin)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.