salesforcelightning

Lightning:Card- underline title


I have a lightening card in my component.

 <lightning:card title="My Title">
        <lightning:layout horizontalAlign="left" class="slds-m-ertical_medium">
            <lightning:layoutItem size="3">
                <lightning:badge label=""/>
            </lightning:layoutItem>
            <lightning:layoutItem size="7">
                   ......
            </lightning:layoutItem>
        </lightning:layout>
</lightning:card>

I've been looking for a way to underline the title "My Title". But I haven't been able to find any. Can someone help ?


Solution

  • Looking at the lightning design system documentation, it looks like that title is given the style class slds-text-heading_small, so you should be able to get the desired effect by adding this to your component's style section:

    .THIS .slds-text-heading_small{
        text-decoration : underline ;
    }