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 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!!!

其他提示

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

许可以下: CC-BY-SA归因
scroll top