【发布时间】:2026-02-19 05:25:01
【问题描述】:
如何在谷歌浏览器上解决这个问题:
当我尝试测试响应能力时,这是在我的网站 (www.haagsehof.nl) 上。这就是发生的事情。
即使这个也不正确,你可以看到头部丢失了。我认为这是 WordPress 内部的 CSS 问题。因为我在 WordPress 中使用自定义 HTML 制作了这个部分,你可以在这里看到:
<!DOCTYPE html>
<html>
<style>
html, body{ height: 100%; width:100%;}
#pl-4 {
background: url(https://www.haagsehof.nl/content/uploads/2018/02/20171120_Haagsehof_1300_blackoverlay.jpg) no-repeat center center;
-webkit-background-size: 100%;
-moz-background-size: 100%;
-o-background-size: 100%;
background-size: 100%;
margin-left: -15px;
margin-right: -15px;
}
@media only screen and (max-width: 399px) {
#pl-4{
background: url(https://www.haagsehof.nl/content/uploads/2018/03/15214591016010952.jpg) fixed no-repeat center center ;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
margin-left: -15px;
margin-right: -15px;
}
}
.wrapper{
margin-top: 150px;
}
div, body{
margin: 0;
padding: 0;
font-family: exo, sans-serif;
}
.wrapper { height: 100%; width: 100%; }
#headerSchoon{
color: white !important;
text-align: center !important;
}
#textSchoon{
color: white !important;
text-align: center !important;
font-size: 150%;
}
</style>
<body id="mainSchoonMaker">
<link href='https://fonts.googleapis.com/css?family=Exo:400,900' rel='stylesheet' type='text/css'>
<div class="wrapper">
<div class="message">
<h1 id="headerSchoon">Schoonmaakwerk is mensenwerk</h1>
<p id="textSchoon"> Wij willen door middel van een persoonlijke en mensgerichte aanpak betrokkenheid creëren tussen schoonmaakmedewerker, klant en schoonmaakbedrijf Haagsehof. Hierdoor ontstaat er een chemie die leidt tot een optimale dienstverlening, waarbij u als klant door ons en onze medewerkers volledig wordt ontzorgd.</p>
</div>
</div>
</body>
</html>
这里出了什么问题,我怎样才能显示完整的图像,你可以向上和向下滚动并且它对于电话设备和普通计算机具有相同的样式?多谢。
===编辑=== 使用后:
#pl-4 {
background: url(https://www.haagsehof.nl/content/uploads/2018/02/20171120_Haagsehof_1300_blackoverlay.jpg) no-repeat center center;
background-size: cover;
margin-left: -15px;
margin-right: -15px;
}
【问题讨论】:
-
什么尺寸?似乎已经正常工作了?
-
@vel 好吧,在普通的 chrome 窗口中它很好,但是当你像手机一样缩小它时,图像就消失了(白色背景),文本也是白色的,在普通的 chrome 版本中,照片中的人物头像不见了。这就是问题你能看到这些东西吗?
-
您需要更改移动版 div 中的背景图片。我想我已经说过了。您现在有 FTP 访问权限了吗?
-
@vel 我可以通过 cpanel 访问服务器!
-
你需要添加一些类到中心 div。