gpt4 book ai didi

html - HTML/CSS 上的额外像素

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

我想将我的文本放在网页的某个部分,但是当我将 left: 0px; 更改为 left: 130px; 时,它创建的像素导致出现单杠。知道如何解决这个问题吗?

CSS

.main4{
text-align: left;
left: 0px;
line-height: 70px;
margin-top: -30px;
position: absolute;
top: 8px;
width: 98.7%;
font-family: "Times New Roman", Times, serif;
font-size: 18px;
margin-bottom: 0px;
display: block;
}

HTML

<div class="main4">
<h1>Upon Doctor's advice</h1>
<h1>Upon advice by family, friends, relatives, another previous patient</h1>
<h1>Recommended by hospital employee</h1>
<h1>Employee's hospital privilege</h1>
<h1>Reputation as the center of best doctors</h1>
<h1>Recommended for good nursing care</h1>
<h1>Others (Please specify): </h1>
</div>

左:130px;

enter image description here

左:0px;

enter image description here

最佳答案

只需删除 width: 98.7%;

.main4{
text-align: left;
left: 130px;
line-height: 70px;
margin-top: -30px;
position: absolute;
top: 8px;
font-family: "Times New Roman", Times, serif;
font-size: 18px;
margin-bottom: 0px;
display: block;
}
<div class="main4">
<h1>Upon Doctor's advice</h1>
<h1>Upon advice by family, friends, relatives, another previous patient</h1>
<h1>Recommended by hospital employee</h1>
<h1>Employee's hospital privilege</h1>
<h1>Reputation as the center of best doctors</h1>
<h1>Recommended for good nursing care</h1>
<h1>Others (Please specify): </h1>
</div>

关于html - HTML/CSS 上的额外像素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44711411/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com