[英]Issues with background image on website
I need a website and I have coded a landingpage until I finish the full page. 我需要一个网站,并且我已经编码了一个到达页面,直到完成整个页面为止。
However, I have run into an issue on mobile devices. 但是,我在移动设备上遇到了问题。
The page looks beautiful on my PC as well as on vertical view on my phone, but as soon as I tilt my phone to horizontal mode, the background freaks out and starts showing wrong. 该页面在PC上以及手机的垂直视图上看起来都很漂亮,但是当我将手机倾斜到水平模式时,背景就会突然消失并开始显示错误。
I have read through my code quite a few times and I cannot for the life of me figure out what is messing up the backgroundimage. 我已经阅读了很多遍代码,我一生都无法弄清楚是什么弄乱了backgroundimage。
I therefore seek your guidance. 因此,我寻求您的指导。
Source code is: 源代码是:
HTML 的HTML
<!DOCTYPE html>
<html lang="da">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Echers Media</title>
<link href="https://fonts.googleapis.com/css?family=Lato:300i,400,700" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="css/app.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" integrity="sha384-DNOHZ68U8hZfKXOrtjWvjxusGo9WQnrNx2sqG0tfsghAvtVlRW3tvkXWZh58N9jp" crossorigin="anonymous">
</head>
<body>
<div class="container">
<div class="row">
<div class="col-lg-12">
<div id="content"><img class="logo" src="../billeder/echersmedialogo.png">
<h4>Lyd, video, grafik, webdesign & programmering</h4>
<h3><em>- Branding personliggjort ét sted</em></h3>
<hr>
<div class="info">
<h4>Vi arbejder på at lancerer vores nye hjemmesiden hurtigst muligt.</h4>
<p>Mail: <strong>kontakt@echersmedia.dk</strong><br>
Tlf.: <strong>28 26 95 94</strong><br>
Cvr.: <strong>37899860</strong></h4>
</p>
</div>
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
</body>
</html>
CSS 的CSS
body {
background: url(../billeder/baggrund.png);
background-size: cover;
background-position: center;
font-family: 'Lato', sans-serif;
color: #353535;
}
.info {
font-size: 1.2em;
}
html {
height: 100%;
}
#content {
text-align: center;
padding-top: 10%;
size: 50%
}
.logo {
width: 40%;
}
hr {
border-top: 1px solid #353535;;
border-bottom: 1 solid #353535;
width: 60%;
}
Looking at your I don't see much which could break your background image in the body. 看着你,我看不到什么东西会破坏你体内的背景图像。 One suggestion I can give you is you can add
background-repeat: no-repeat
so that background image doesn't get repeated. 我可以给您的一个建议是,您可以添加
background-repeat: no-repeat
这样背景图像就不会重复。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.