HTML/CSS上的额外像素
我想把我的文字放在网页的某个部分,但当我改变HTML/CSS上的额外像素,html,css,Html,Css,我想把我的文字放在网页的某个部分,但当我改变左:0px至左侧: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;
左:0px代码>至<代码>左侧: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代码>
水平条是由于内容超出其父级宽度造成的。在这里,您将.main4
130px移到右侧,这将使其超出其父级的宽度。您需要(a)可能使用填充,而不是绝对位置,或者(b)减小.main4
的宽度,直到不发生这种情况。只需删除宽度:98.7%代码>
.main4{
文本对齐:左对齐;
左:130像素;
线高:70px;
利润上限:-30px;
位置:绝对位置;
顶部:8px;
字体系列:“泰晤士报新罗马”,泰晤士报,衬线;
字号:18px;
边缘底部:0px;
显示:块;
}
根据医生的建议
根据家人、朋友、亲戚和另一位以前的患者的建议
医院员工推荐
雇员的医院特权
作为最佳医生中心的声誉
建议进行良好的护理
其他(请具体说明):
我使用了宽度:90%来减小宽度,水平条消失了。非常感谢你+祝你好运