Html 如何将跨度的背景色设置为外部div?

Html 如何将跨度的背景色设置为外部div?,html,css,Html,Css,我想将重置密码的背景色设置为外部div的最大宽度。背景色必须是标题部分的全宽。如何操作 html: <div class="forgot-inner"> <!--Forgot-header--> <div class="forgot-header"> <div class="header">

我想将重置密码的背景色设置为外部div的最大宽度。背景色必须是标题部分的全宽。如何操作

html:

<div class="forgot-inner">
            <!--Forgot-header-->
                    <div class="forgot-header">
                        <div class="header">
                        <span>Reset Password</p>
                        </div>
                    </div>
</div>
        .forgot-inner {
        max-width: 331px;
        margin: 39px auto;
        padding: 13px 24px;
        background: #fff;
        text-align: center;
        border: 1px solid #aaa;
        border-radius: 4px;
        box-shadow: 2px 11px 31px 2px rgba(0,0,0,0.2);
    }

    .forgot-inner .forgot-header .header{
        border-bottom:1px solid #aaa;
        text-align:left;
        background-color:#edefed;
        width:100% !important;
        font-size: 14px;
        font-weight: bold;
    }    

{
最大宽度:331px;
利润率:39px自动;
填充:13px 24px;
背景:#fff;
文本对齐:居中;
边框:1px实心#aaa;
边界半径:4px;
盒影:2px11px31px2pxrgba(0,0,0,0.2);
}
.忘记内部.忘记页眉.页眉{
边框底部:1px实心#aaa;
文本对齐:左对齐;
宽度:100%!重要;
字体大小:14px;
字体大小:粗体;
}  
.forget-inner.forget-header.header span{背景色:#edefed;}

重置密码

您可以尝试以下方法:

margin: -13px -24px;