Home > front end >  With and the relationship between height and absolute positioning?
With and the relationship between height and absolute positioning?

Time:02-05

Why I set up the item2, right, and bottom and item2 width is high, it can stretch upwards, rather than stretching down based on the right, and bottom?

 



<meta charset="utf-8" & gt;
<meta name="viewport" content="width=device - width" & gt;
JS Bin
<style>
The box {
position: relative;
width: 300px;
Height: 100 px;
Border: 10 px solid red;
box-sizing: border-box;
}

The item2 {
position: absolute;
right: -10px;
bottom: -10px;
Width: 0 px;
height: 0px;
box-sizing: border-box;
Border: 10 px solid transparent;
}

Box: hover. Item2 {

box-sizing: border-box;
width: 300px;
Height: 100 px;
Border - color: black.
The transition: all 1 s;

}
</style>

<body>




CodePudding user response:

You can understand the item2 positioned in the lower right corner, for you
If you want him down and extended, right so you can locate it in the top left corner,

  • Related