gpt4 book ai didi

HTML 网站在发布后进行奇怪的优化?

转载 作者:行者123 更新时间:2023-11-28 03:17:56 25 4
gpt4 key购买 nike

我今天早些时候刚刚发布了我的网站,我注意到它在实际启动和运行时有一些不同之处。这是我编码的样子

enter image description here

这是我在手机上打开网站时的样子

enter image description here

当我把它拉到我的电脑上时,甚至还有一些错误,让我怀疑这些是否是优化问题......如果有人能帮助我保留我的所有方面,我会把代码留在下面无论查看设备如何,都可以将网站放在一个地方!

@font-face {
font-family: "My Custom Font";
src: url(fonts/font.ttf) format("truetype");
}

body {
background: url(img/bg.png) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
o-background-size: cover;
background-size: cover;
font-family: "My Custom Font", Times, serif;
max-width: 100%;
overflow-x: hidden;
}

#headerbg {
height: 450px;
width: 710px;
background-color: rgb(28, 28, 28);
position: relative;
top: 100px;
border-radius: 15px;
opacity: 0.6;
}

.header {
position: relative;
bottom: 345px;
color: white;
padding-right: 30px;
}

#logo {
position: relative;
bottom: 605px;
right: 210px;
}

#inputbg {
width: 375px;
height: 550px;
background-color: rgb(28, 28, 28);
position: relative;
left: 168px;
bottom: 150px;
border-radius: 15px;
opacity: 0.6;
}

.input {
color: white;
text-align: center;
position: relative;
bottom: 320px;
left: 170px;
}

#firsttxt {
position: relative;
bottom: 900px;
left: 45px;
color: white;
}

#lasttxt {
position: relative;
bottom: 938px;
left: 187px;
color: white;
}

#emailtxt {
position: relative;
bottom: 933px;
left: 103px;
color: white;
}

#downloadhere {
position: relative;
bottom: 1512px;
left: 169px;
}

#enterbtn {
width: 135px;
height: 50px;
color: rgb(186, 209, 225);
background-color: rgb(203, 38, 38);
border-color: rgb(203, 38, 38);
font-size: 20px;
position: relative;
text-align: center;
}

#benefits {
position: relative;
bottom: 1900px;
color: white;
text-align: center;
}

.pdfdisplay {
position: relative;
bottom: 860px;
left: 175px;
}
<!DOCTYPE html>

<html>

<head>

<title>P2 Fitness Company</title>
<link rel="stylesheet" type="text/css" href="style.css">

</head>

<body>
<center>
<div id="headerbg"></div>
<div class="header">
<h1>FREE PDF WITH 7 TIPS TO BOOST <br>YOUR PROGRESS IN THE GYM</h>
</div>
<div id="logo">
<img src="img/p2fitnesstransparent.png" width="350px" height="150px">
</div>
<div id="inputbg"></div>

<div class="input">
<form method="get" action="files/7tips.pdf">
<input type="text" name="first" size="15">
<input type="text" name="last" size="15"> <br> <br>
<input type="text" name="email" size="20"> <br> <br>
<input id="enterbtn" type="submit" value="DOWNLOAD">
</form>
</div>

<div class="pdfdisplay">
<img src="img/pdfdisplay.png" height="400px" width="400px">
</div>
<h5 id="firsttxt">FIRST*</h5>
<h5 id="lasttxt">LAST*</h5>
<h5 id="emailtxt">EMAIL*</h5>

<img src="img/downloadhere.png" id="downloadhere">

</center>

<div id="benefits">
<h2>BENEFITS OF PDF</h2>

<h3>-Utilize the the time you are<br>already spending in the gym</br>
-Learn new ways to gain muscle</br>
-Learn to live a healthier lifestyle</br>
-Reduce risk of injury</h3>
</div>

</body>

</html>

最佳答案

主要问题是您使用 px 对尺寸进行了硬编码。所以页面没有响应。如果你想让它完美地工作,那么你必须让它响应不同的视口(viewport)。
BootStrap是使页面响应的好选择。此外,您可以通过利用 vwvhvmin 属性使其响应。
link来自 w3schools 的文章也可能对您有所帮助。

关于HTML 网站在发布后进行奇怪的优化?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45367211/

25 4 0
文章推荐: javascript - 弱映射内存泄漏
文章推荐: c++ - 重载模板类的赋值运算符
文章推荐: html - 如何将 转换为
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com