我想将我的文本放在网页的某个部分,但是当我将 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;
左:0px;
最佳答案
只需删除 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/