当前位置:Gxlcms > html代码 > 介绍html中定位fixed的实例代码

介绍html中定位fixed的实例代码

时间:2021-07-01 10:21:17 帮助过:70人阅读

本篇文章主要介绍了html中定位fixed实例代码,对于html教程有兴趣的同学可以参考一下。

  1. <html>
  2. <head>
  3. <title>123</title>
  4. <style>
  5. #sub1{
  6. width:50px;
  7. height:80px;
  8. border:1px solid #dcdcdc;
  9. }
  10. #sub2{
  11. position:fixed;
  12. top:250px;
  13. right:20px;
  14. width:50px;
  15. height:80px;
  16. border:1px solid #dcdcdc;
  17. margin-top:5px;
  18. }
  19. #sub3{
  20. width:250px;
  21. height:880px;
  22. border:1px solid #dcdcdc;
  23. margin-top:5px;
  24. }
  25. </style>
  26. </head>
  27. <body>
  28. <p id="parent">
  29. <p id="sub1">sub1</p>
  30. <p id="sub2">sub2</p>
  31. <p id="sub3">sub1</p>
  32. </p>
  33. </body>
  34. </html>

以上就是介绍html中定位fixed的实例代码的详细内容,更多请关注Gxl网其它相关文章!

人气教程排行