Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/30.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 如何设置不同模板的页脚位置,如果内容非常少,页脚应定位为固定位置或相对位置_Html_Angular - Fatal编程技术网

Html 如何设置不同模板的页脚位置,如果内容非常少,页脚应定位为固定位置或相对位置

Html 如何设置不同模板的页脚位置,如果内容非常少,页脚应定位为固定位置或相对位置,html,angular,Html,Angular,如何调整页脚位置,路由后如果模板内容较少,则应固定在位置上,另一个模板中的内容较多,而页脚位置应为相对位置 app.component.html 标题内容 类别 单位 页脚内容 使用CSS类,如 .fixedClass { position: fixed; bottom: 0; } 可以使用ng class属性将此类应用于页脚 <footer ng-class="{fixedClass: expression}"> Footer Conten

如何调整页脚位置,路由后如果模板内容较少,则应固定在位置上,另一个模板中的内容较多,而页脚位置应为相对位置

app.component.html

标题内容
  • 类别
  • 单位
页脚内容
使用CSS类,如

.fixedClass {
    position: fixed;
    bottom: 0;
}
可以使用
ng class
属性将此类应用于页脚

<footer ng-class="{fixedClass: expression}">
    Footer Contents
</footer>

页脚内容
表达式应该决定内容的“大小”,这是您应该定义的;如果内容基于高度或字符数较少。

请使用CSS类,如

.fixedClass {
    position: fixed;
    bottom: 0;
}
可以使用
ng class
属性将此类应用于页脚

<footer ng-class="{fixedClass: expression}">
    Footer Contents
</footer>

页脚内容

表达式应该决定内容的“大小”,这是您应该定义的;如果内容基于高度或字符数较少。

谢谢,但如果固定位置直接指定给页脚,则它将应用于其他模板谢谢,但如果固定位置直接指定给页脚,则它将应用于其他模板,但在company.html页面中,div标记内不存在任何内容。所以在那个特定的模板上,它应该是固定的。然后,如果我导航到page category.html页面,其中有一些内容(假设md卡中有很多内容),那么页脚应该是空的,但在company.html页面中,div标记中没有内容。所以在那个特定的模板上,它应该是固定的。然后,如果我导航到page category.html页面,其中有一些内容(假设md卡中有很多内容),那么页脚应该是相对的