html - 导航栏后面的图片
问题描述
使用引导程序 4 和 html为我的项目制作这样的登录页面,而 html 无法隐藏导航栏后面的背景图像
解决方案
我已经在我的Codepen帐户上完成了此操作,唯一的区别是您必须更改我将徽标放在导航栏的位置,并且不要使其成为 img div 的中心,使其像你提供的例子。
见下文:
<div class="header_img">
<div class="row logo-container-div align-items-center justify-content-center">
<div class="logo-wrapper col-auto" >
<h1>LOGO HERE</h1>
<p>Some additional text</p>
</div>
</div>
</div>
CSS:
.header_img {
height: 800px;
width: 100%;
background-image: linear-gradient(150deg, rgba(68, 0, 139, 0.7), rgba(47, 0, 120, 0.6) 10%, rgba(27, 57, 129, 0.5) 30%, rgba(41, 123, 192, 0.5) 50%, rgba(114, 240, 255, 0.6) 86%, rgba(84, 183, 249, 0.7)), url("http://www.strawberryproofing.co.uk/images/nature_large1.png");
background-position: 0%, 0%, 50%, 50%;
background-attachment: scroll, fixed;
background-size: auto, cover;
}
.logo-container-div {
min-height: 70vh;
}
.logo-wrapper {
font-family: 'Raleway', sans-serif;
padding: 25px 30px;
border: 2px solid white;
color:#fff;
text-align:center;
position: fixed;
}
.logo-wrapper h1 {
font-size: 36px;
}
.logo-wrapper p {
font-size: 18px;
}
在这里查看:https ://codepen.io/billyfarroll/pen/qYWYYV
您将需要flex
:justify
和align
元素以及background-position
&background-size
推荐阅读
- java - 如何从方法退出回到菜单选择?
- azure-devops - 如何使用 Azure DevOps Services .NET SDK 获取所有项目迭代的列表?
- python - 如何获取所有白色斑点的像素位置
- python - 如何将 ID 添加到仅在满足特定条件时才增加的 pyspark 数据帧行?
- xamarin.forms - 使用 PRISM Xamarin Forms 的依赖注入不起作用
- grafana - Grafana 定义图表的标题值
- javascript - 将 innerHTML 改回其原始值,但使用 JavaScript 获得“未定义”
- javascript - 如何在html中添加视频
- java - 使用资源文件夹从 Eclipse 部署 AWS Lambda 函数的问题
- r - 如何为两列的唯一值汇总行