Set height in layout

I need to set “auto” height of layout. I tried this:

goalLayout = new HorizontalLayout();
goalLayout.setWidth(“100%”);
goalLayout.setPrimaryStyleName(“goal_layout”);

and in styles writed:

.goal_layout {
height: auto;
}

but is doesn’t work and vaadin sets layout fixed height. Why and how to fix this? I don’t set height in any parent layouts.

What are you trying to achieve with the auto height?

HorizontalLayout has undefined height by default, so it will contract/expand to fit the contained components.

I need to display error message of input. I was added attaches for view of it. I use CSValidator plugin for validation.
13050.png
13051.png

Try removing the CSS. The height of the layout should automatically adjust itself based on the content.

It doesn’t working, I tried.

Then you are going to need to provide us with more than that. There might be something wrong in your layout hierarchy. One thing you could try to do, is open the debug window (add the parameter ?debug to your url), and press on “analyze layouts” (AL). See the console output for possible problems. If problems are found, try to fix those errors and see if the problems still occurs.