运行 ❯
获取您
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <head> <style> #parentDiv{ position: relative; width: 60%; height: 250px; border: solid black 1px; } #myDiv{ position: absolute; background-color: lightblue; inset: 15px 30px; } </style> </head> <body> <h1>The inset Property</h1> <div id="parentDiv"> <div id="myDiv">This div element has a distance of 15 pixels to parent at top and bottom, and to 30 pixels from left and right.</div> </div> </body> </html>