html - 背景不要填满整个部分
问题描述
我在一个测试项目中使用此模板(http://www.display-inline.fr/demo/developr/template/inbox.html),但是,当我更改部分<section role="main" id="main">
以使用该类carbon
时,背景未完全填充.
我尝试使用 调整该部分的大小style='height: 100%'
,但是没有用。如何用碳类背景填充整个页面?
解决方案
而不是使用height:100%
你应该使用height:100vh
.wrapper {
background-image: url("https://i.stack.imgur.com/fhEwl.png");
height: 100vh;
background-repeat: no-repeat;
}
<div class="wrapper">text</div>
推荐阅读
- sql - SQl 汇总表:一列相对于另一列的部分总和
- javascript - 更改 Morris.js 条形图的默认颜色
- spring-boot - Spring Boot 未调用 SuccessAuthentication 处理程序
- multithreading - stanford-corenlp 中的默认线程数是多少
- android - 在使用 Firebase 登录但未获取所有用户性别时检索用户性别?
- python - 为什么引号的类型会改变字符串的值?- Python
- html - 在屏幕中央创建一个浮动 iframe
- three.js - 从辅助“调试”相机查看时,三个 js 相机助手不移动
- javascript - 是否可以创建与 Java 等效的 UUID 生成器的 Javascript 版本
- batch-file - 使用批处理文件添加到 PATH 环境变量 (Windows 10)