开发者

How to have an inner DIV width go outside the padding of the outer DIV?

<div style="padding:20xp;width:100%;"
    <div style="width开发者_运维知识库:?????">

    <div>
</div>

I would like the inner div to fill the screen completely, even when the outer div has 20px padding. How can that be done? thanks.


Give the inner <div> a negative margin to negate the padding and fill the width, example:

<div style="padding:20px;">
    <div style="margin: -20px;">
      Content Here
    <div>
</div>
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜