Magento2 How to apply CSS on static block class in PWA
-
25-02-2021 - |
Question
I have created one Static block and added below content in :
<div class="hero-banner"><img src="{{media url='banner.jpg'}}" alt="" width="1251" height="343"></div>
Called this static block in CMS page
{{block class="Magento\\Cms\\Block\\Block" block_id="hero-banner"}}
How can I apply css on hero-banner class in PWA ?
I can add css only HTML tags.
Solution
I got solution :
You can add class in Static block like below code :
<div class="hero-banner">banner image</div>
Please use the code sample below in your imported CSS file .
:global(.hero-banner) {
/*some css rules here*/
}
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange