We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to center image inside panel

Thread ID:





148950 Nov 8,2019 11:56 AM UTC Nov 11,2019 11:22 AM UTC Blazor 1
Tags: Dashboard Layout
Asked On November 8, 2019 11:56 AM UTC

I am trying to center image inside panel, but this  doesn't work no matter how I try

   var y = new PanelModel();
            if (stringo != string.Empty)
                y = new PanelModel()
                    Content = "<div style=\"text-align: center; vertical-align: middle; align-content: center; align-items: center; align\"> <img style=\"border:1px solid black;\" src=\"data:image/png;base64," + stringo + "\"></>",
                    SizeX = 1,
                    SizeY = 1

Sowmiya Padmanaban [Syncfusion]
Replied On November 11, 2019 11:22 AM UTC

Hi Waleed, 
Thanks for contacting Syncfusion support. 
We have checked your reported query that image does not align center in  dashboard layout panel. You can add the below CSS style to align the image tag center in dashboard layout panel. 
Refer the below code snippet. 
#image { 
       height: 100%; 
       width: 100%; 
       justify-content: center; 
       display: flex; 
       align-items: center; 
For your reference, we have prepared a sample. 
Please let us know, if you have any concerns. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon