LABEL HTML

I’ m trying to show a Html page with a label. But I’m doing something wrong. This is a test that not work.


public class ThemeLayout extends CssLayout{
	
	Label label=new Label("",Label.CONTENT_XHTML);
	
	public  ThemeLayout() {
		label.setValue(
				"<html>"+
				"<head>"+
				"<style type='text/css'>" +
				  "body {" +
				    "color: purple;" +
				    "background-color: green }" +
				  "</style>"+
				"</head>" +

				"<body>" +
				"TEST" +
				"</body>" +
				"</html>");
		addComponent(label);
	}

}

Can someone tell me what is wrong?

Label with XHTML content will attach that content within the DOM tree that is already showing on the screen. So, you can’t attach a ‘full page’ with head and body to the DOM tree node.