Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 如何在高度转换期间保持文本的位置?_Html_Css - Fatal编程技术网

Html 如何在高度转换期间保持文本的位置?

Html 如何在高度转换期间保持文本的位置?,html,css,Html,Css,我想保持文本的位置,但当鼠标悬停在div上时,文本会向下移动 html 在css中添加以下内容: p { position:absolute; top:100px; } .添加此 p { position: fixed; top: 125px; } 位置:绝对位置?@jacelysh我已经尝试过了,但没有成功,即使绝对位置,文本仍然会移动?奇怪。@jacelysh在hiral下面找到了答案 p { position:absolute; to

我想保持文本的位置,但当鼠标悬停在div上时,文本会向下移动

html


在css中添加以下内容:

p {
    position:absolute;
    top:100px;
}
.

添加此

p
 {
    position: fixed;
    top: 125px;
 }

位置:绝对位置
?@jacelysh我已经尝试过了,但没有成功,即使绝对位置,文本仍然会移动?奇怪。@jacelysh在hiral下面找到了答案
p {
    position:absolute;
    top:100px;
}
p
 {
    position: fixed;
    top: 125px;
 }