开发者

CSS Positioning Fixed in Parent Container

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜