Reputation: 4014
I have this website where I have used some angular
ng-tags
but I have problems with my background to expand along with the tags.
I have two examples where this is the case:
hidden
to visible
with ng-hide
ng-bind-html
is too long
Both examples are from the same page code
index.html
<body ng-app="unityAcademyApp">
<div id="gradient">
<div id="background">
...
<div id="container">
<div ui-view=""></div> <!-- Calling main.html -->
</div>
...
</div>
</div>
</body>
main.html
<section>
<article>
...
<div id="article-content" ng-bind-html="article.translation.content"></div>
<div id="article-comments">
...
<nav class="button-menu-center">
<a href class="btn btn-default" ng-click="showComment()"><label class="fa fa-comment"> Comment</label></a>
</nav>
<div class="article-comment" ng-show="comment.show">
<text-angular ng-model="comment.content"
ta-toolbar="[['h1','h2','h3','h4','h5','h6','quote'],
['bold','italics','underline','strikeThrough','ul','ol'],
['insertLink','wordcount','charcount']]">
</text-angular>
<nav class="button-menu-right">
<a href class="btn btn-success" ng-click="save()"><label class="fa fa-check"> Save</label></a>
</nav>
</div>
</div>
</article>
</section>
app.css
body{
width: 100%;
background-color: black;
background-image: url(../assets/images/woodBackgroundTilable.jpg);
}
body,
#gradient,
#background,
#sidebar{
height: 100vmax;
}
#gradient{
position: absolute;
top:0px;
width: 100%;
min-width: 960px;
background: linear-gradient(to left, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 20%, rgba(0,0,0,1) 80%, rgba(0,0,0,0) 100%);
}
#background{
position: relative;
top:0px;
width: 80%;
max-width: 1362px;
margin: 0 auto;
background: url(../assets/images/pergament.png) repeat-y;
background-size: contain;
}
#container{
position: relative;
top:100px;
width: 90%;
margin: auto;
margin-bottom: 100px;
}
#article-content{
color:rgb(0,0,0);
}
.article-comment{
width: 60%;
margin: 10px auto;
border: 1px solid #999;
border-radius: 10px;
padding: 8px;
background: rgba(255,255,255,0.5);
}
.article-comment.ng-hide-add {
animation: 0.5s fadeOut ease;
}
.article-comment.ng-hide-remove {
animation: 0.5s fadeIn ease;
}
/* fade out */
@keyframes fadeOut {
0% {
opacity: 1;
}
100% {
opacity: 0;
}
}
/* fade in */
@keyframes fadeIn {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
As you can see I've tried with height:100vmax
since I understood that this would get the full page height, where height:100%
might not always give that. However I suspect that I misunderstood it somewhere.
Also as you can see the body sees the height of the page just fine, it's only the #background
and #gradient
which doesn't.
Upvotes: 1
Views: 102
Reputation: 272
Maybe try playing with the overflow
css property? Something like overflow: auto;
Upvotes: 1