Teaser Component Title I would like to Center
I would like to write a custom style value to Center the Title in the Teaser Component. I do not see an example of this.
I would like to write a custom style value to Center the Title in the Teaser Component. I do not see an example of this.
You are right, the CSS style classes are set at the parent level, but you can make use of inheritance while writing the CSS to pick the specific element.
For instance, you can specify the selector for picking up the title, for instance, you can set the style class the template like "cmp-teaser-title-centre", and use this selector in CSS to pick the title which is in H2 with the default class name "cmp-teaser__title". That would ensure that aligning only affects the title.
So your CSS might look like this.
.cmp-teaser-title-centre .cmp-teaser__title{
text-align: center;
}
hope this helps!
Regards,
Nitesh
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.