首页 > Web开发 > 详细

CSS - Position

时间:2018-09-25 13:56:51      阅读:150      评论:0      收藏:0      [点我收藏+]

练习了不同的定位方式

 

The Position Test

1234
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">

    <link rel = "stylesheet" href="CSS.css">
    <title>The Position Test</title>
</head>
<body>
    <dir id="one">1</dir>
    <dir id="two">2</dir>
    <dir id="three">3</dir>
    <dir id="four">4</dir>
</body>
</html>

  这是CSS.css文件

* {
    border: 2px solid #357;
    padding: 120px;
    width: 100px;
    height: 100px;
}

#one {
    background-color: blueviolet;
    position: relative;
}

#two {
    background-color: peru;
    position: absolute;
}

#three {
    background-color: lawngreen;
    position: relative;
}

#four {
    background-color: darkred;
    position: static;
}

  

CSS - Position

原文:https://www.cnblogs.com/ghostang/p/9698978.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!