Q:

why code snippet in stack overflow did not support the css property height if value is in percentage

This is my doubt since started to use the code snippet,the code snippet didn't take the css property  height if value is in percentage.i added the code below. 

aside {
width:50px;
  height:100%;
  background-color:yellow;
}
<aside>
 </aside>

but it will display width even if value is in percentage .i'm added code of that too. 

aside {
width:100%;
 height:50px;
  background-color:red;
}
<aside>
</aside>

is there any alternatives i can use  instead of height:100%; in code snippet ,because that is a great factor in responsive design. 

A:

They do but as with all HTML the 100% has to have something to relate to.  Usually this is the html or body elements. 

aside {
  width: 50px;
  height: 100%;
  background-color: yellow;
}
html,
body {
  height: 100%;
  margin:0;
  padding:0;
}
<aside>
</aside>

