How to avoid the generation of undesirable markup for caption above img?

To add my own logo I use the next code:

Embedded logo = new Embedded(null, new ThemeResource("img/logo.png"));

The problem is that it generates the next html markup, which I want to avoid (because it generates extra space above my image):

<div class="v-caption v-caption-debug" style="width: 503px; margin-left: 0px;">
	<div class="v-captiontext">&nbsp;</div>
	<div class="v-caption-clearelem"></div>

Does somebody knows how to avoid the generation of that undesirable




In Vaadin, component captions are usually rendered by their parent layouts (one of the exceptions being the Button component). That’s way captions render differently e.g. for a VerticalLayout and a FormLayout.
The Book of Vaadin
has additional info.

Regarding to your question, you cannot prevent the layout from creating the HTML-elements (unless you want to write your own layout) but you can easily hide the elements via CSS, for example by adding .parentLayoutClass .v-caption-debug {display: none;}

Thanks Risto… I will try it