Customize the card image title position in Angular Card component

17 Nov 20223 minutes to read

Card Image titles are placed as always Bottom-Left Corner only, You can manually customize to placing titles anywhere over the image by adding styles.

import { Component, ViewChild } from '@angular/core';
import { DropDownList } from '@syncfusion/ej2-dropdowns';

    selector: 'app-container',
    template: `
            <div class="e-card">
                <div class="e-card-image">
                    <div class="e-card-title">Node.js</div>
                <div class="e-card-content">
                    Node.js is a wildly popular platform for writing web applications that has revolutionized web development in many ways, enjoying
                    support across the open source community as well as industry.
    <div style="Margin: 5px 0;width:300px">
        <select id="title_position">
            <option value="bottom-left">BottomLeft</option>
            <option value="top-left">TopLeft</option>
            <option value="top-right">TopRight</option>
            <option value="bottom-right">BottomRight</option>
    </div>        `

export class AppComponent {
    @ViewChild('element') element;

ngAfterViewInit () {
// initialize DropDownList component
let dropDownListObject: DropDownList = new DropDownList({
    placeholder:"Select Position",
    change: changed,

// render initialized DropDownList
function changed(e) {
    let cardEle = document.querySelector('.e-card');
    let titleEle = cardEle.querySelector('.e-card-image .e-card-title');
    titleEle.className = ''

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';

 * Module
    imports: [
    declarations: [AppComponent,],
    bootstrap: [AppComponent]
export class AppModule { }
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { enableProdMode } from '@angular/core';
import { AppModule } from './app.module';