0

In css, how we can fixed width(in full 100% not in px) of a div which have property is position fixed inside the div which already used postion absolute property.

let me know about its. this issue I am facing for long time.Is there any solution of this?

1 Answers1

0

I'm not sure if this is what you want but I find a solution on this post : Set width of a "Position: fixed" div relative to parent div

It use width:inherit

.parent {
  background-color: red;
  width: 200px;
  height: 200px;
  position: absolute;
  left: 20px;
  top: 20px;
}

.child {
  background-color: blue;
  position: fixed;
  width:inherit;
}
<div class="parent">
  <div class="child">test</div>
</div>
Romain
  • 45
  • 7