Angular内容不允许后台扩展

时间:2015-09-26 14:52:31

标签: html css angularjs

我有这个网站,我使用了一些angular ng-tags,但我的背景问题与标签一起扩展。

我有两个例子,就是这种情况:

  • 第一个是从hiddenvisible的某个地方ng-hide

enter image description here

  • 第二个是ng-bind-html中的文字太长

enter image description here



两个示例都来自同一页面代码

的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;
    }
}

正如您所看到的,我已尝试使用height:100vmax,因为我知道这会获得整页高度,而height:100%可能并不总是这样。但是我怀疑我在某个地方误解了它。

另外,正如您可以看到正文看到页面的高度一样好,它只是#background#gradient没有。

1 个答案:

答案 0 :(得分:1)

也许尝试使用overflow css属性?像overflow: auto;

这样的东西