Problem Statement:
I simply haveam trying to apply custom CSS to a lightning-input component inside a nested structure. However, neither external CSS nor inline styles seem to work, even with the !important tag.
HTML Code:
<div>
<div>
<div class="custom-label">
<lightning -input label="enter input"></lightning -input>
</div>
</div>
</div>
neither external css nor inline css are working, even with !important
tag in css not working, the css i applied wasCSS Code:
.custom-label .slds-form-element__label {
font-size:16 px;16px;
coliorcolor: red;
font-weight: bold;
}
Issue:
The CSS styles I applied are not workingbeing reflected in the component. I tried using the !important tag, but it still doesn’t work. Questions:
Why is the custom CSS not being applied to the lightning-input label? How can I correctly apply custom styles to lightning-input labels? What I Have Tried:
Ensured that the CSS file is properly included and linked. Used the !important tag, but it still didn’t work. Additional Context:
I am using this component inside a Salesforce Lightning Web Component (LWC). Is there a special way to apply custom CSS to standard Lightning components?
Thank you!