Home > Web Front-end > CSS Tutorial > Detailed introduction to the default position of child tags in css parent tags

Detailed introduction to the default position of child tags in css parent tags

高洛峰
Release: 2017-03-20 16:29:53
Original
1600 people have browsed it

This article shares a detailed introduction to the default position of the child tag in the css parent tag

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
.a{
width: 100px;
height: 100px;
background: red;
position: relative;
top: 40px;
left: 50px;
padding: 30px;
}
.b{
width: 50px;
height: 50px;
background: bisque;
position: absolute;
}
</style>
</head>
<body>
<p class="a">
<p class="b"></p>
</p>
</body>
</html>
Copy after login

If you do not set top and left for the b tag. They will have a default value.

top and left will be positioned based on width and height.

The above is the detailed content of Detailed introduction to the default position of child tags in css parent tags. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
css
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template