gpt4 book ai didi

html - 背景中的超大屏幕完整图像

转载 作者:太空宇宙 更新时间:2023-11-04 13:12:27 25 4
gpt4 key购买 nike

我试着让我的形象完全占据 jumtron 不幸的是我仍然不知道我做错了什么你能检查一下吗?它的图像似乎以某种方式被切割并且看起来不太好:

现在的样子: enter image description here

我的超大屏幕在哪里的代码(最后):

<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8">
<title>My Logo</title>
<meta name="description" content="Wiredwiki App">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="custom.css">

<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css">
</head>

<style>
body{
padding-top: 40px;
}
</style>

<body data-spy="scroll" data-target="#my-navbar">

<!-- Navbar -->
<nav class="navbar navbar-inverse navbar-fixed-top" id="my-navbar">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>

<a href="" class="navbar-brand">My logo</a>
</div><!-- Navbar Header-->
<div class="collapse navbar-collapse" id="navbar-collapse">

<!--<a href="" class="btn btn-warning navbar-btn navbar-right">Download Now</a>-->
<ul class="nav navbar-nav">
<li><a href="#feedback">Feedback</a>
<li><a href="#gallery">Gallery</a>
<li><a href="#features">Features</a>
<li><a href="#faq">Faq</a>
<li><a href="#contact">ContactUs</a>
</ul>
</div>
</div><!-- End Container-->
</nav><!-- End navbar -->

<!-- jumbotron-->

<div class="jumbotron">
<div class="container">
</div><!-- End container -->
</div><!-- End jumbotron-->

还有我正在努力实现的 custom.css:

.jumbotron
{
position: relative;
background: #000 url("1.png") center center;
width: 100%;
height: 100%;
background-size: cover;
overflow: hidden;
}

根据@potatopeelings 的更改,它看起来像这样: enter image description here

据@Shirin 说: enter image description here

最佳答案

有了您链接到的 Bootstrap ,我认为您需要在顶部填充更多内容。

改变

body{
padding-top: 40px;
}

body{
padding-top: 50px;
}

并且您的图像不会在顶部被剪掉。

对于您看到的任何其他失真,您实际上可能想要检查您的图像(background-size: cover; 将拉伸(stretch)您的图像以覆盖整个元素,因此如果您的图像不与您的元素具有相同的纵横比,即宽度 x 高度,它看起来会倾斜)

关于html - 背景中的超大屏幕完整图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31499113/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com