We have an LWC and sometimes the title can be really long. I have seen How do I make a Lightning Card title wrap to the next line on a small screen? but that did not help.
Any other suggestions?
<lightning-card variant="Narrow" title={displayText} icon-name="standard:account">
here displayText is passed in as a parameter on the Lightning record page:
<property label="Display Sub-Text" name="displaySubText" type="String"/>
Update: I wonder if this is the reason why it is not working Target inner elements of standard Lightning Web Components with CSS
Best Answer
In documentation the description of title in lightning card says:
Using this information, you could use a slot for placing HTML markup instead of an attribute:
Borrowing the solution from the mentioned post in your question, now you can apply CSS to the title:
Output: