How can we help you today?

How to Change the Alignment of Content in the CTA Card Design Element

By default, the content inside CTA Cards is at the center:


default CTA card alignment


This article will show you how to align the content to the right or to the left using Custom CSS code.


change alignment


TABLE OF CONTENTS


Prerequisites


Interactive Tutorial

Before starting the tutorial, choose the Custom CSS code you want to use:


Option 1: Align Content to the Left

.spx-de-cta-card {
  padding: 50px 60px;
}

.spx-de-cta-card__icon {
    adisplay: flex;
    justify-content: flex-start;
    width: 100%;
    margin-bottom: 20px;
}

.spx-de-cta-card__text {
    align-items: flex-start; 
     width: 100%;
    text-align: left;
}

.spx-de-cta-card__description {
    padding: 0 0px;
    text-align: left;
}

.spx-de-cta-card__buttons {
    align-items: start;
    width: 100%;
    justify-content: flex-start;
}

Option 2: Align Content to the Right

.spx-de-cta-card {
  padding: 50px 60px;
}

.spx-de-cta-card__icon {
    adisplay: flex;
    justify-content: flex-end;
    width: 100%;
    margin-bottom: 20px;
}

.spx-de-cta-card__text {
    align-items: flex-end;
    width: 100%;
    text-align: right;
}

.spx-de-cta-card__description {
    padding: 0 0px;
    text-align: right;
}

.spx-de-cta-card__buttons {
    align-items: end;
    width: 100%;
    justify-content: flex-end;
}
NOTEMake sure that the Enable Icon Background option is disabled. Otherwise, the Custom CSS code will not work as expected. 

disable enable icon background

Step-by-step Tutorial


Follow the detailed guide below to start changing the alignment of the content inside CTA Cards:


Step 1: Edit the ShortPoint Web Part

  • Go to the SharePoint page you want to use and click Edit:


Edit


  • Close the Toolbox:


close icon


  • Edit the ShortPoint web part:


Edit properties icon


Step 2: Copy the Code

  • Choose the Custom CSS code you want to use:


Option 1: Align Content to the Left

.spx-de-cta-card {
  padding: 50px 60px;
}

.spx-de-cta-card__icon {
    adisplay: flex;
    justify-content: flex-start;
    width: 100%;
    margin-bottom: 20px;
}

.spx-de-cta-card__text {
    align-items: flex-start; 
     width: 100%;
    text-align: left;
}

.spx-de-cta-card__description {
    padding: 0 0px;
    text-align: left;
}

.spx-de-cta-card__buttons {
    align-items: start;
    width: 100%;
    justify-content: flex-start;
}


Option 2: Align Content to the Right

.spx-de-cta-card {
  padding: 50px 60px;
}

.spx-de-cta-card__icon {
    adisplay: flex;
    justify-content: flex-end;
    width: 100%;
    margin-bottom: 20px;
}

.spx-de-cta-card__text {
    align-items: flex-end;
    width: 100%;
    text-align: right;
}

.spx-de-cta-card__description {
    padding: 0 0px;
    text-align: right;
}

.spx-de-cta-card__buttons {
    align-items: end;
    width: 100%;
    justify-content: flex-end;
}

Step 3: Edit the CTA Card


NOTEYou must already have a CTA Card Design Element on your SharePoint page. If you don’t have it yet, check out How to Create a SharePoint Announcement Banner Using the CTA Card Design Element.
  • Click the CTA Card tag:


CTA Card tag


  • Select the cogwheel icon:


Cogwheel icon


Step 4: Paste Code

  • Click the next icon:


next icon


  • Go to the Custom CSS tab.
  • Paste the code in the Custom CSS field.


paste code


  • Customize the code as you prefer.
  • Once satisfied, click the green checkmark.


NOTEMake sure that the Enable Icon Background option is disabled. Otherwise, the Custom CSS code will not work as expected. 

disable enable icon background

Step 5: Save

  • Click the eye icon to see your page in real-time:


eye icon


  • Save your changes:


Save


Congratulations! You have successfully changed the content alignment of the CTA Card Design Element.


change alignment


Related articles:

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.

World's best intranet sites are designed using ShortPoint

Get started today! Learn more
See all 63 topics

Start a trial

Ignite your vision. Install ShortPoint directly on your site, or play in sandbox mode. No credit card required.

Get started today

World’s best intranet sites are designed using ShortPoint

Thousands of companies using ShortPoint everyday to design, brand and build award winning intranet sites.

Get started Learn more