前端四角定位代码实例
程序员文章站
2024-01-03 08:19:40
前端四角定位代码实例
...
前端四角定位代码实例
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>四角定位</title> <style> p{ width: 100px; height: 100px; background: red; position: absolute; } #box1{ top: 0; left: 0; } #box2{ top: 0; right: 0; } #box3{ bottom: 0; left: 0; } #box4{ bottom: 0; right: 0; } </style> </head> <body> <p id="box1"></p> <p id="box2"></p> <p id="box3"></p> <p id="box4"></p> </body> </html>