search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

How to align text centered in daypilot event?

Asked by Fabian
2 years ago.

I'm trying to center the text shown on a daypilot event. I tried setting the event.cssClass property to a custom Css Class with

.test-css {
color: white;
background: #1a1a1a;
font-weight: bold;
text-align: center;
}

All attributes are correctly applied - only text-align is ignored. Can you advise?

Answer posted by Dan Letecky [DayPilot]
2 years ago.

The event content div (*_event_inner) uses "display: flex" which prevents "text-align: center" from working. You will need to use "justify-content: center;" instead. It has to be set on the inner div:

.test-css .scheduler_default_event_inner {
  /* ... */
  justify-content: center;
}
Comment posted by Fabian
2 years ago.

That's it. You guys are really doing a great job, thanks a lot!

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.