50% of what?
It should work only if you have set a height for the parent DIV also.
Try this-
#container{
height:500px;
}
#halfOfContainer{
height:50%;
}
If you don't want to set fixed height for you parent div then try this-
html,body{
height: 100%;
}
#container{
height:100%;
}
#halfOfContainer{
height:50%;
}
Check this demo at
jsfiddle[
^]
Hope it helps :)