CSS 位置:静态;

cssweb developmentfront end technology更新于 2024/4/11 14:36:17

 position: static; 属性设置元素的静态位置,这是默认设置。

示例

top、bottom、left 和 right 属性不会影响静态定位元素。您可以尝试运行以下代码来实现 CSS 位置:position: static; 属性。

<!DOCTYPE html>
<html>
   <head>
      <style>
         div.static {
            position: static;
            border: 3px solid blue;
         }
      </style>
   </head>
   <body>
      <h1>Positioning Element</h1>
         <div class="static">
            div element with position: static;
         </div>
   </body>
</html>

输出


相关文章


有用资源