I am developing a Windows 8 Store app with html5/JS, a reading app. The content page looks like :

And I’m using CSS-Grid-Layout to manage the page layout like this:
<body>
<div class="contentPagepage fragment">
<header aria-label="Header content" role="banner">
<button class="win-backbutton black-button" aria-label="Back" disabled type="button"></button>
<h1 class="titlearea win-type-ellipsis">
<span class="pagetitle"></span>
</h1>
<h2>
<span class=""></span>
</h2>
</header>
<div class="content clearfix" aria-label="Main content">
<div id="leftContainer">
<p>Left container</p>
</div>
<section id="rightContainer">
<div id="navContainer">
<button type="button">button 1</button>
<button type="button">button 2</button>
<button type="button">button 3</button>
</div>
<!--<article>-->
<div id="contentContainer" class="item-content" aria-label="Main content">
html content
</div>
</section>
</div>
</div>
</body>
And the css file is:
.contentPagepage, .black-button {
background-color: #EEEEEE;
color: black;
}
.clear{ clear: both; }
.clearfix:after{
content:"."; display:block; height:0; clear:both;
visibility:hidden;
font-size: 0;
}
*html .clearfix{
height:1%;
}
*+html .clearfix{
height:1%;
}
.contentPagepage .content {
-ms-grid-row-span: 2;
display: -ms-grid;
-ms-grid-columns: 40% 60%;
height: calc(100% - 183px);
margin: 133px 120px 0 120px;
border: 1px solid #000;
}
#leftContainer {
height: calc(100% - 183px);
-ms-grid-column: 1;
background-color: greenyellow;
margin: 0 10px 10px 0;
}
#rightContainer{
-ms-grid-column: 2;
display: -ms-grid;
-ms-grid-rows: 30px auto;
}
#navContainer {
-ms-grid-row: 1;
}
#contentContainer {
-ms-grid-row: 2;
overflow-y: auto;
height: calc(100% - 0px);
}
.contentPagepage .content #contentContainer {
-ms-grid-row: 2;
height: auto;
background-color: red;
display: block;
overflow-y: auto;
}
Now the layout system works fine, but the content area got fixed too, this means if I use the “lement.querySelector(“.content .item-content”).innerHTML = item.content;” to load some html content, there is no scrollbar even the conent’s height is larger than the container.
So, how can I fix this problem?
First remove the “
.contentPagepage.content#contentContainer” block from CSS.Then replace the
#rightContainerand#contentContainerwith this: