gpt4 book ai didi

html - 位置 : absolute issue on different browser

转载 作者:太空宇宙 更新时间:2023-11-04 04:33:13 24 4
gpt4 key购买 nike

我有一个定位的绝对 div,其中将附加文本

<div id="text_head">
<p class="dot">·</p>
<div class="line"></div>
<div class="line"></div>
<p id="p_head">Here is my</p>
<p id="p_sub">WEB DESIGN</p>
</div>

和下面的CSS

.dot {
color: #FFFFFF;
font-size: 80px;
left: 131px;
position: absolute;
top: 22px;
}

.line { 
background-color: #FFFFFF;
height: 2px;
position: absolute;
right: 0;
top: 67px;
width: 118px;
}

正如您在此 Picture 中看到的那样两种浏览器呈现的方式不同!我将 margin: 0pxpadding: 0px 设置为 p 元素的默认样式!

任何帮助将不胜感激!编辑额外的 CSS:

p { margin: 0;
padding: 0;
color: #FFF;
}

#p_head {
font-family: impregnable_personal_use_onRg;
font-size: 74px;
margin: 0;
padding: 0;
}

#p_sub {
font-family: alternategothic2_btregular;
font-size: 54px;
margin: 0;
padding: 0;
position: absolute;
right: 0;
}

最佳答案

可能是 line-height 的问题。您是否尝试重置 p 上的行高?

p {line-height: 1.2;}

或者你可以重置所有的行高:

body {line-height: 1.2;}

关于html - 位置 : absolute issue on different browser,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16882885/

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