如何在html中保持x,y坐标中的文本



我正试图通过HTML将文本放在我网站页面的x,y坐标窗口中,我该怎么做?这是我迄今为止的代码:

<!DOCTYPE html>
<html>
<head>
<center><h1>Hello</h1></center>
</head>
</html>

目前,该代码将具有";你好"在窗户中央,但我要在(100100(。

使用position:fixedtop:100pxleft:100px:

<!DOCTYPE html>
<html>
<head>
<style>
h1 {
position: fixed;
top: 100px;
left: 100px;
}
</style>
</head>
<body>
<h1>Hello</h1>
</body>
</html>

最新更新