缩小页眉,完全删除页脚
Downsizing header, removing footer entirely
我是working/designing一个网站的前端(在布局html+css,后面会用到php,mvc模式)。该网站有页眉、正文、侧边菜单和页脚布局已准备就绪。
有一些表格不寻常 long/huge,因为所有字段都是必需的,我无法缩短它们。表单在新页面中打开。
不是为了吓跑用户,我打算缩小表单模板上的页眉(设计更改仅适用于表单模板)并完全删除页脚。
我试着找了几个地方,但没有找到如何完成它。简而言之,我希望网站拥有所有块,即页眉、正文、页脚,但是当涉及到表单时,我想缩小页眉并删除页脚以使表单看起来更时尚。
有办法吗?
注意:我post没有代码,因为我对代码没有问题,但概念。
您可以将 display: none
用于仅适用于此页面的 CSS 规则中的 footer
元素(例如,在该页面头部的 style
标记中页)。
关于页眉,这取决于它是如何构建的,是否有徽标、背景图像、文本、菜单等等。一般来说,您可以减少 height
、缩小徽标、隐藏其中的部分文本等。
You can also done this thing using angularjs
ng-include
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<body >
<div ng-include="'header.html'">
</div>
<div ng-include="'footer.html'">
</div>
</body>
</html>
确保页面的 body
有 class,例如 .no-footer .small-header
或 .form-page
。然后在您的 CSS 样式表中,使用如下内容:
body.no-footer #footer{
display:none;
}
body.small-header #header{
height:50px;
/* or whatever you want to apply to make the header smaller */
}
我是working/designing一个网站的前端(在布局html+css,后面会用到php,mvc模式)。该网站有页眉、正文、侧边菜单和页脚布局已准备就绪。
有一些表格不寻常 long/huge,因为所有字段都是必需的,我无法缩短它们。表单在新页面中打开。
不是为了吓跑用户,我打算缩小表单模板上的页眉(设计更改仅适用于表单模板)并完全删除页脚。
我试着找了几个地方,但没有找到如何完成它。简而言之,我希望网站拥有所有块,即页眉、正文、页脚,但是当涉及到表单时,我想缩小页眉并删除页脚以使表单看起来更时尚。
有办法吗?
注意:我post没有代码,因为我对代码没有问题,但概念。
您可以将 display: none
用于仅适用于此页面的 CSS 规则中的 footer
元素(例如,在该页面头部的 style
标记中页)。
关于页眉,这取决于它是如何构建的,是否有徽标、背景图像、文本、菜单等等。一般来说,您可以减少 height
、缩小徽标、隐藏其中的部分文本等。
You can also done this thing using angularjs
ng-include
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<body >
<div ng-include="'header.html'">
</div>
<div ng-include="'footer.html'">
</div>
</body>
</html>
确保页面的 body
有 class,例如 .no-footer .small-header
或 .form-page
。然后在您的 CSS 样式表中,使用如下内容:
body.no-footer #footer{
display:none;
}
body.small-header #header{
height:50px;
/* or whatever you want to apply to make the header smaller */
}