Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

How are Div components laid out?

Zac Harvey
3 years ago Jun 29, 2019 7:24pm
Olli Tietäväinen
3 years ago Jul 01, 2019 6:48am
Zac Harvey
3 years ago Jul 01, 2019 10:53am
Olli Tietäväinen
3 years ago Jul 01, 2019 11:22am

There are examples of Div usage e.g. in the Business App starter. You can add styles directly through the Element API, like with myComponent.getElement().getStyle().set("background","red"), but I wouldn't recommend doing that, at least to any large degree - use class names and separate CSS files instead. You can find examples of that from the Business App Starter as well.