开发者

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

开发者 https://www.devze.com 2022-12-21 03:12 出处:网络
<div style=\"padding:20xp;width:100%;\" <div style=\"width开发者_运维知识库:?????\"> <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

精彩评论

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

关注公众号