Datefield text alignment

Hi,
In vaadin, how to align the selected date in center of the datefield . please provide corresponding css.
Thanks

This should add a text-align style to the input inside the Datefield.

.datefieldcentered >input{
  text-align: center;
}

i tried its not working :frowning:

Did you set the style of the datefield accordingly?
Did you check using some tool like firebug if the style is attached to the datefield?

i set the style of datefield obj. but not wrkng. can u provide me exact code for adding style for date field.

Have you compiled your theme?

ya i compiled.

I put

DateField df = new DateField(); df.setStyleName("datefieldcentered"); layout.addComponent(df); in my UI and

.datefieldcentered >input{ text-align: center; } in my styles.scss (should work with styles.css as well).
Then i load my site and if the theme didn’t properly load i delete the cache and reload (Ctrl + Shift + R in Firefox and Chrome)
…and it seems to work

Thanks a lot. :slight_smile: