0

In the address section at My account dashboard, there is a field called Country. I want to change the CSS for that country's input.

Where do I need to add CSS class in order to change it?

<div class="field country required">
    <label class="label" for="country"><span><?= /* @noEscape */ $block->getAttributeData()->getFrontendLabel('country_id') ?></span></label>
    <div class="control">
        <?= $block->getCountryHtmlSelect() ?>
    </div>
</div>

Any help will be appreciated!

  • you want to add class inside <select/> ? – Kishan Savaliya Oct 21 '19 at 7:32
  • Yes, correct but here we are getting that from block. So, I'm not sure where I have to add the class. – Siva Oct 21 '19 at 7:37
  • Okay I'll let you know after some time – Kishan Savaliya Oct 21 '19 at 7:37
1

You need not to add a new class in that select box. You can use the below class to change the CSS of the select country box on the account dashboard page.

.account .field.country select#country { 
    /* your CSS here */ 
}

Hope it helps!!!

| improve this answer | |
  • 1
    Thanks. Its working – Siva Oct 21 '19 at 10:34
1

Where to place the css style is based on the type of change.

Reference to the Documentation

Check the theme enabled for your website you want to do these changes.

Magento\app\design\frontend\<theme>\*\web\css\blackdemo.css

Example: In my case it is.

Magento\app\design\frontend\Solwin\freego\web\css\blackdemo.css

add the style you want..

.account #country{
// place you styles here
}

Dont forget the cache Cache documentation

Through CLI: php magento cache:clean

Through admin:

enter image description here

Don't forget the cache Cache documentation

| improve this answer | |

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.