Put some html code to auto-generate page

Hello Guys,
can I use some html code in myMainPage class which extends UI - this page is generated by Vaadin and I don’t use any html form ? If yes, then where and how I can paste some code into head section?
I want use code like this:

Thanks for help, and sorry for english.

Hi,
you should try this:
https://vaadin.com/forum/#!/thread/1676923/3436649

Hmm yes, but can I impelement this in class which extends UI interface ?

public class SomeClass extends UI {
.
.
.
protected void init(VaadinRequest request) {
.
.
.
}
}

Unfortunately, it’s too late at the point UI.init is called - the HTML page the UI resides in is already generated and sent to the client. You can manipulate the page with javascript (eg. Page.getJavaScript().execute() or a custom extension) but I’m not sure if it helps in your use case.