Hey guys,
so i’ve been messing with relative and absolute position and my question is:
an inline element with position:relative wont respect it width or height. Because of its inline condition.
But why an inline element with position:absolute will do it? As you can see in the example below it respects its 100x100 px. Why? Its because it puts the element out of the normal flow so any display wont work on it anymore?
For example:
<style>
.square1{
background-color:red;
height: 100px;
width: 100px;
display:inline;
position: relative;
}
.square2{
background-color:blue;
height: 100px;
width: 100px;
display:inline;
position:absolute;
}
</style>
<body>
<div class="square1">wawaw </div>
<div class="square2"> rewrew</div>
</body>