开发者

CSS Positioning Fixed in Parent Container

开发者 https://www.devze.com 2023-04-12 06:00 出处:网络
How can I have an element to be fixed positioned while its width is always 100% of its parent element?

How can I have an element to be fixed positioned while its width is always 100% of its parent element?

The parent element is as follows:

div.panel-left
{
    width: 35%;
    float:left;
    position:relative;
    display: table;
    text-align: right;
}

Thanking you

Note: other similar questions I saw on stackoverflow do not so开发者_JAVA技巧lve the width issue stated above.


Do you mean something like this?

Css

div.inner {
   position: absolute;
   left: 0;
   right: 0;
   ...
}

Html

<div class="panel-left">
   <div class="inner">something</div>
</div>
0

精彩评论

暂无评论...
验证码 换一张
取 消