You need to sign in to do that
Don't have an account?
Jugbeer Bhola
Color to entire Card
Hello, Trying to apply a color to an entire card. Should be easy but it has not turned out to be that way. Does anyone have suggestions? I have attached an image of what I am trying ot accomplish.
In order to remove the space between the title and the body, you can give the entire body in one section only.
Please refer to the following code as it may be helpful in solving your problem:
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks and Regards,
Deepali Kulshrestha
All Answers
In order to give color to your card, you must put your card in a container and then give the CSS class to that container. Please go through the following code as it may be helpful in resolving your problem:
<div class="background">
<article class="slds-card background">
<div class="slds-card__header slds-grid">
<header class="slds-media slds-media_center slds-has-flexi-truncate">
<div class="slds-media__figure">
<span class="slds-icon_container slds-icon-standard-account" title="account">
<!-- <svg class="slds-icon slds-icon_small" aria-hidden="true">
<use xlink:href="/assets/icons/standard-sprite/svg/symbols.svg#account"></use>
</svg>-->
<span class="slds-assistive-text">account</span>
</span>
</div>
<div class="slds-media__body">
<h2 class="slds-card__header-title">
<a href="javascript:void(0);" class="slds-card__header-link slds-truncate" title="Accounts">
<span>Accounts</span>
</a>
</h2>
</div>
<div class="slds-no-flex">
<button class="slds-button slds-button_neutral">New</button>
</div>
</header>
</div>
<div class="slds-card__body slds-card__body_inner">Anything can go into the card body</div>
<footer class="slds-card__footer">
<a class="slds-card__footer-action" href="javascript:void(0);">View All
<span class="slds-assistive-text">Accounts</span>
</a>
</footer>
</article>
</div>
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks and Regards,
Deepali Kulshrestha.
the title and body that wont go away. Any other ideas?
In order to remove the space between the title and the body, you can give the entire body in one section only.
Please refer to the following code as it may be helpful in solving your problem:
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks and Regards,
Deepali Kulshrestha