简体   繁体   English

缩小后,为什么网页上的文本没有保留在原位?

[英]Why does the text on my webpage not stay in place when zoomed out?

Web dev. 网络开发人员 noob here! 菜鸟在这里! In Chrome when I zoom out on this page , the text gets crunched up into the corner. 在Chrome浏览器中,当我缩小此页面时 ,文本会变紧到角落。 It doesn't happen when I use Safari though. 但是,当我使用Safari时,它不会发生。 I'm assuming it's a CSS issue and/or the way I've entered it into HTML. 我假设这是CSS问题和/或我将其输入HTML的方式。 I've put it on jsfiddle here . 我把它放在这里 jsfiddle上。

.second {
font-family: helvetica neue, arial, sans-serif;
font-size: 30px;
font-weight: lighter;
line-height: 5px;
position: relative;
top: 5px;
width: 500px;
margin-left: -330px;

}

.third {
font-family: helvetica neue, arial, sans-serif;
font-size: 40px;
font-weight: lighter;
line-height: 0px;
position: relative;
top: 5px;
margin-bottom: 70px;
width: 500px;
margin-left: -330px;
}

.fourth {
font-family: helvetica neue, arial, sans-serif;
font-size: 20px;
font-weight: lighter;
line-height: 0px;
position: relative;
top: 30px;
width: 500px;
margin-left: -335px;
background-color: white;


<p class="second"><b>Barter</b> a textbook <b>you have</b></p>
<p class="second">for a textbook <b>you want</b></p>
<p class="second">with a fellow <b>Aggie</b> on campus,</p>
<p class="third"><b><i>now</i></b>.</p> 
margin-left: -330px;

because you are using negative margin thats why it hide in the screen 因为您使用的是负边距,所以它隐藏在屏幕中

and also your link is working fine in my chrome 而且您的链接在我的Chrome中也可以正常工作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM