我不是专业的网络开发人员,我在下面有类似的问题,因为我的一些页面并没有缩小到适合移动设备的视口。景观似乎很好。
Website Not Resizing Correctly on iPhone Portrait
我之前使用视口metatag确实让网站正常工作,但自iOS更新以来,它全部恢复为实际网页大小。我根据这个建议删除了元标记(它不是一个响应式网站)
http://blog.javierusobiaga.com/stop-using-the-viewport-tag-until-you-know-ho
有些网页可以正常使用,有些则无法正常使用。这没有道理! CSS在所有页面上都是相同的,但它们的显示方式不同,“图像”,“如何工作”和“定价”都表现得很好。其他页面在视口外渗出。有什么想法吗?
谢谢!
以下是错误页面的HTML:
<link rel="stylesheet" type="text/css" href="webfonts/MyFontsWebfontsKit.css">
<link href="source/style.css" rel="stylesheet" type="text/css" />
<meta name="description" content="FUN & SON - bespoke photography for kids" />
<title>
FUN & SON - bespoke photography for kids
</title>
</head>
<body bgcolor="#d0d0d0">
<div id="container1">
<div class="image">
<img src="images/header.png" width="1200px" height="144px" name="background"/>
<h1>
<a href="aboutus2.html">ABOUT US</a>
<br />
<a href="images.html">IMAGES</a>
<br />
<a href="howitworks.html">HOW IT WORKS</a>
<br />
<a href="pricing.html">PRICING & PRODUCTS</a>
<br />
<a href="https://funandson2016.wordpress.com/">BLOG</a>
<br />
<a href="press.html">PRESS</a>
<br />
<a href="contact.html">CONTACT US</a>
<br />
<br />
<br />
<br />
<a href="https://www.instagram.com/funandson/"><img src="images/insta.png" width="50px" height="50px" name="dot"/></a>
<a href="https://www.facebook.com/Fun-Son-Bespoke-Photographic-Service-for-Kids-354285164695429/?ref=hl"><img src="images/fb.png" width="50px" height="50px" name="dot"/></a>
</h1>
<div id="copycontainer">
<h3>
<p style="margin-left: 60px; margin-top: 75px">
Coming soon
</p>
</h3>
<br />
<br />
</div>
</div>
</body>
CSS也非常标准:
#container {
width:1200px;
}
#container1 {
width:1200px;
}
#container2 {
width: 770px;
float:left;
margin-top:95px;
margin-left:432px;
}
#copycontainer {
width: 800px;
height: auto;
float:left;
margin-top:70px;
margin-left:360px;
}
.cover a:hover {
text-shadow: 2px 2px: #ffffff;
}
.images {
float: left;
padding-left: 10px;
padding-top: 10px;
}
.image {
margin:auto;
position: relative;
width: 100%; /* for IE 6 */
}
.placeholder {
background-color: #FF0;
margin-top: 10px;
margin-right: 10px;
padding-top: 0px;
float:left;
}
h1 {
font-family: CeraStencilPRO-Light;
font-weight: normal;
font-style: normal;
color: #7e7e7e;
font-size: 22px;
line-height:40px;
position: absolute;
top: 185px;
left: 0;
margin-left: 20px;
margin-top: 60px;
width: 100%;
z-index:-20000;
}
h2 {
font-family: CeraStencilPRO-regular;
font-weight: normal;
font-style: normal;
color: #7e7e7e;
font-size: 20px;
margin-top: 35px;
}
h3 {
font-family: Helvetica;
font-weight: normal;
font-style: normal;
color: #7e7e7e;
font-size: 16px;
margin-top: 35px;
line-height: 21px;
}
h4 {
font-family: CeraStencilPRO-Light;
font-weight: normal;
font-style: normal;
color: #7e7e7e;
font-size: 22px;
line-height:40px;
position: absolute;
top: 185px;
left: 0;
margin-top: 60px;
margin-left: 20px;
width: 100%;
}
h5 {
font-family: Helvetica;
font-weight: normal;
font-style: normal;
color: #7e7e7e;
font-size: 19px;
line-height: 21px;
}
答案 0 :(得分:-1)
您应该使用bootstrap进行响应式网页设计。它易于学习,您可以快速创建响应式HTML页面。
包含bootstrap后插入此SELECT 'a' AS "This is an a", 'b' AS "but this is a b" FROM DUAL;
并将html页面的内容包装在bootstrap网格系统中。
w3schools上的初学者教程。