大家好,又见面了,我是你们的朋友全栈君。
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>css绝对定位的重新认知</title>
<style> .box{
width: 300px; height: 300px; display: flex; justify-content: center; align-items: center; font-size: 16px; font-weight: 400; color: #fff; background-color: cornflowerblue; position: relative; } .son{
position: absolute; top: 0; left: 0; width: 50px; height: 50px; background-color: blueviolet; } </style>
</head>
<body>
<div class="box">this is a box
<div class="son"></div>
</div>
</body>
</html>
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/210089.html原文链接:https://javaforall.cn