html/css中框状元素的全宽标题

html/css中框状元素的全宽标题,html,css,sass,Html,Css,Sass,我正在尝试使用scss(saas)和Bootstrap 4复制管理员LTE: 实现这一点的代码如下(我必须将编译的css放在示例中),也可以在我的上找到: .box{ 位置:相对位置; 保证金:2倍; 边框:1px纯黑; 边界半径:5px; /*标题*/ } .box.box标题{ 显示:块; 位置:相对位置; 框大小:边框框; 高度:3em; 边框底部:1px纯黑; /*按钮组的包装器*/ } .盒.盒头h1、.盒.盒头h2、.盒.盒头h3、.盒.盒头h4、.盒.盒头h5、.盒.盒头h6{ 显

我正在尝试使用scss(saas)和Bootstrap 4复制管理员LTE:

实现这一点的代码如下(我必须将编译的css放在示例中),也可以在我的上找到:
.box{
位置:相对位置;
保证金:2倍;
边框:1px纯黑;
边界半径:5px;
/*标题*/
}
.box.box标题{
显示:块;
位置:相对位置;
框大小:边框框;
高度:3em;
边框底部:1px纯黑;
/*按钮组的包装器*/
}
.盒.盒头h1、.盒.盒头h2、.盒.盒头h3、.盒.盒头h4、.盒.盒头h5、.盒.盒头h6{
显示:内联块;
字号:2em;
浮动:左;
线高:2米;
}
.box.box标题.box工具箱{
位置:绝对位置;
顶部:5px;
右:10px;
显示:内联块;
浮动:对;
}
.box.box-header.bg-primary h1、.box.box-header.bg-primary h2、.box.box-header.bg-primary h3、.box.box-header.bg-primary h4、.box.box-header.bg-primary h5、.box.box-header.bg-primary h6{
颜色:#fdfdfd;
}
.box.box页脚{
显示:块;
位置:相对位置;
边框顶部:1件纯黑;
}
.box.box内容{
显示:块;
位置:相对位置;
宽度:100%;
}

标题
1.
2.
3.
4.
真正的多洛雷姆·维塔提斯(Dolorem Veriatis)是一位老谋深算的人。应将voluptatem和ipsam accusantium est。这是我的梦想。应将假设错误放在解决方案上,使其成为最大可能。大兰丹准
镨等。别名消费性腐败非消费性生活必需品和其他物品、流动性和建筑设计师,甚至在劳动产权方面。《意大利宪法》的发明人雷德亨德里特·多洛·阿特克·莫利塔
康莫迪·杜西莫斯·波罗。Porro et non alias aperiam dolorum veniam quo。维尼亚姆市的普罗维登特·多洛雷斯。他是一位来自多洛勒姆市的代表,他是一位自命不凡的人。这是一个令人振奋的时刻。临时动物
我在巴黎的产房。我的产房很不舒服。非政府组织的主要职责和职权范围。非政府组织的主要职责和职权范围必须是共同的。非偶发性复发性疾病
这是我们的实验室。
页脚
标题
1.
2.
3.
4.
真正的多洛雷姆·维塔提斯(Dolorem Veriatis)是一位老谋深算的人。应将voluptatem和ipsam accusantium est。这是我的梦想。应将假设错误放在解决方案上,使其成为最大可能。大兰丹准
镨等。别名消费性腐败非消费性生活必需品和其他物品、流动性和建筑设计师,甚至在劳动产权方面。《意大利宪法》的发明人雷德亨德里特·多洛·阿特克·莫利塔
康莫迪·杜西莫斯·波罗。Porro et non alias aperiam dolorum veniam quo。维尼亚姆市的普罗维登特·多洛雷斯。他是一位来自多洛勒姆市的代表,他是一位自命不凡的人。这是一个令人振奋的时刻。临时动物
我在巴黎的产房。我的产房很不舒服。非政府组织的主要职责和职权范围。非政府组织的主要职责和职权范围必须是共同的。非偶发性复发性疾病
这是我们的实验室。
页脚

如果两个标题和盒装内容位于同一容器中,则无法实现全宽标题和盒装内容。一个简单的解决方案是将标题HTML移出容器

    .box {
      position: relative;
      margin: 2px;
      border: 1px solid black;
      border-radius: 5px;
      /*Header*/
    }
    .box .box-header {
      display: block;
      position: relative;
      box-sizing: border-box;
      height: 3em;
      border-bottom: 1px solid black;
      /* Wrapper For Button Groups */
    }
    .box .box-header h1, .box .box-header h2, .box .box-header h3, .box .box-header h4, .box .box-header h5, .box .box-header h6 {
      display: inline-block;
      font-size: 2em;
      float: left;
      line-height: 2em;
    }
    .box .box-header .box-toolbox {
      position: absolute;
      top: 5px;
      right: 10px;
      display: inline-block;
      float: right;
    }
    .box .box-header.bg-primary h1, .box .box-header.bg-primary h2, .box .box-header.bg-primary h3, .box .box-header.bg-primary h4, .box .box-header.bg-primary h5, .box .box-header.bg-primary h6 {
      color: #fdfdfd;
    }
    .box .box-footer {
      display: block;
      position: relative;
      border-top: 1px solid black;
    }
    .box .box-content {
      display: block;
      position: relative;
      width: 100%;
    }

<!-- language: lang-html -->

    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">

<div class="box-header bg-primary">
  <h1>Title</h1>
  <div class="box-toolbox">
    <div class="btn-group" role="group" aria-label="Box Icons">
      <button type="button" class="btn btn-secondary">1</button>
      <button type="button" class="btn btn-secondary">2</button>
      <button type="button" class="btn btn-secondary">3</button>
      <button type="button" class="btn btn-secondary">4</button>
   </div>
</div>
          </div>

    <div class="container">
      <div class="row">
        <div class="box col">
          <div class="box-content">Dolorem veritatis provident ut et. A aut et sapiente accusamus et alias. Deserunt voluptatem et ipsam accusantium est. Est enim esse nihil dolorem. Deserunt assumenda error sit soluta.Facilis sint eveniet possimus magnam. Magni laudantium quasi
            a praesentium et a. Alias consequatur corrupti non consequatur qui vitae necessitatibus et. Occaecati et aliquid et. Architecto eveniet aspernatur pariatur quia laborum. Itaque cumque magnam impedit inventore reprehenderit dolor atque mollitia.Aut
            commodi ducimus porro. Porro et non alias aperiam dolorum veniam quo. Provident dolores veniam eum.Qui reprehenderit quam dolorum qui incidunt voluptates aut. Iure rerum eius molestias voluptatem quo laudantium nobis. Ex animi temporibus velit
            laborum at est odit pariatur.Laborum qui qui impedit eum. Non eos quo rem dolor quibusdam et. Amet dolorem magni vitae sequi deserunt et officia rem. Aspernatur harum non repellat omnis a commodi quo ipsum. Non ea quod recusandae id. Est iure
            corporis quisquam laboriosam aut.
          </div>
          <div class="box-footer">
            footer
          </div>
        </div>
      </div>
    </div>
.box{
位置:相对位置;
保证金:2倍;
边框:1px纯黑;
边界半径:5px;
/*标题*/
}
.box.box标题{
显示:块;
位置:相对位置;
框大小:边框框;
高度:3em;
边框底部:1px纯黑;
/*按钮组的包装器*/
}
.盒.盒头h1、.盒.盒头h2、.盒.盒头h3、.盒.盒头h4、.盒.盒头h5、.盒.盒头h6{
显示:内联块;
字号:2em;
浮动:左;
线高:2米;
}
.box.box标题.box工具箱{
位置:绝对位置;
顶部:5px;
右:10px;
显示:内联块;
浮动:对;
}
.box.box-header.bg-primary h1、.box.box-header.bg-primary h2、.box.box-header.bg-primary h3、.box.box-header.bg-primary h4、.box.box-header.bg-primary h5、.box.box-header.bg-primary h6{
颜色:#fdfdfd;
}
.box.box页脚{
显示:块;
位置:相对位置;
边框顶部:1件纯黑;
}
.box.box内容{
显示:块;
位置:相对位置;
宽度:100%;
}
标题
1.
2.
3.
4.
真正的多洛雷姆·维塔提斯(Dolorem Veriatis)是一位老谋深算的人。应将voluptatem和ipsam accusantium est。这是我的梦想。应将假设错误放在解决方案上,使其成为最大可能。大兰丹准
镨等。别名消费性腐败非消费性生活必需品和其他物品、流动性和建筑设计师,甚至在劳动产权方面。《意大利宪法》的发明人雷德亨德里特·多洛·阿特克·莫利塔
康莫迪·杜西莫斯·波罗。Porro et non alias aperiam dolorum veniam quo。维尼亚姆市的普罗维登特·多洛雷斯。他是一位来自多洛勒姆市的代表,他是一位自命不凡的人。这是一个令人振奋的时刻。临时动物
我在巴黎的产房。我的产房很不舒服。非eos-rem
    <div class="box col p-0">