<small id='xrzoU'></small><noframes id='xrzoU'>

    <bdo id='xrzoU'></bdo><ul id='xrzoU'></ul>
  • <tfoot id='xrzoU'></tfoot>

        <i id='xrzoU'><tr id='xrzoU'><dt id='xrzoU'><q id='xrzoU'><span id='xrzoU'><b id='xrzoU'><form id='xrzoU'><ins id='xrzoU'></ins><ul id='xrzoU'></ul><sub id='xrzoU'></sub></form><legend id='xrzoU'></legend><bdo id='xrzoU'><pre id='xrzoU'><center id='xrzoU'></center></pre></bdo></b><th id='xrzoU'></th></span></q></dt></tr></i><div id='xrzoU'><tfoot id='xrzoU'></tfoot><dl id='xrzoU'><fieldset id='xrzoU'></fieldset></dl></div>

      1. <legend id='xrzoU'><style id='xrzoU'><dir id='xrzoU'><q id='xrzoU'></q></dir></style></legend>
      2. 完整的背景和固定的内容

        时间:2023-08-01

          <i id='2atWF'><tr id='2atWF'><dt id='2atWF'><q id='2atWF'><span id='2atWF'><b id='2atWF'><form id='2atWF'><ins id='2atWF'></ins><ul id='2atWF'></ul><sub id='2atWF'></sub></form><legend id='2atWF'></legend><bdo id='2atWF'><pre id='2atWF'><center id='2atWF'></center></pre></bdo></b><th id='2atWF'></th></span></q></dt></tr></i><div id='2atWF'><tfoot id='2atWF'></tfoot><dl id='2atWF'><fieldset id='2atWF'></fieldset></dl></div>
        • <tfoot id='2atWF'></tfoot>

          <small id='2atWF'></small><noframes id='2atWF'>

            <legend id='2atWF'><style id='2atWF'><dir id='2atWF'><q id='2atWF'></q></dir></style></legend>

              <bdo id='2atWF'></bdo><ul id='2atWF'></ul>
                <tbody id='2atWF'></tbody>
                  本文介绍了完整的背景和固定的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有以下两个总宽度应为 1400 像素的容器.我的代码中的问题是,当我希望两个容器为 1400 像素时,背景不是 100% 宽度.

                  I've got the following two containers that should be 1400px width in total. The problem in my code is that the background isn't 100% width when I want the two containers to be 1400px.

                  我怎样才能以最好的方式实现这一目标?我希望你们能解决我的问题.

                  How can I achieve this the best way? I hope you guys get my problem.

                  我正在使用以下代码:

                  .wrapper {
                    max-width: 1400px;
                    margin: 0 auto;
                    padding: 0 50px;
                  }
                  
                  #left-container {
                    width: 50%;
                    background: blue;
                    float: left;
                  }
                  
                  #right-container {
                    width: 50%;
                    background: green;
                    float: left;
                  }

                  <div class="wrapper">
                  
                    <div id="left-container">
                  
                      <h2>Left container</h2>
                  
                    </div>
                  
                    <div id="right-container">
                  
                      <h2>Right container</h2>
                  
                    </div>
                  
                  </div>

                  推荐答案

                  可以通过多种方式完成.我现在能想到的最简单的解决方案就是添加一个容器并使用线性渐变:

                  It can be done in many ways. The most simple solution I can think of now is to add a container and use a linear gradient:

                  body {margin:0; padding:0;}
                  .container {
                    background: linear-gradient(to left, blue 50%, green 50%);
                  }
                  .wrapper {
                    border: 1px solid white;
                    max-width: 1400px;
                    margin: 0 auto;
                    overflow: auto;
                  }
                  
                  #left-container,
                  #right-container{
                    box-sizing: border-box;
                    width: 50%;
                    float: left;
                    padding-left: 50px;
                  }

                  <div class="container">
                    <div class="wrapper">
                      <div id="left-container">
                        <h2>Left container</h2>
                      </div>
                      <div id="right-container">
                        <h2>Right container</h2>
                      </div>
                    </div>  
                  </div>

                  这篇关于完整的背景和固定的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:在网格中动态更改类型 下一篇:当 Material Ui 网格包含在 div 元素中时布局中断

                  相关文章

                    • <bdo id='IcmFL'></bdo><ul id='IcmFL'></ul>
                      <i id='IcmFL'><tr id='IcmFL'><dt id='IcmFL'><q id='IcmFL'><span id='IcmFL'><b id='IcmFL'><form id='IcmFL'><ins id='IcmFL'></ins><ul id='IcmFL'></ul><sub id='IcmFL'></sub></form><legend id='IcmFL'></legend><bdo id='IcmFL'><pre id='IcmFL'><center id='IcmFL'></center></pre></bdo></b><th id='IcmFL'></th></span></q></dt></tr></i><div id='IcmFL'><tfoot id='IcmFL'></tfoot><dl id='IcmFL'><fieldset id='IcmFL'></fieldset></dl></div>
                    1. <tfoot id='IcmFL'></tfoot>
                    2. <small id='IcmFL'></small><noframes id='IcmFL'>

                      <legend id='IcmFL'><style id='IcmFL'><dir id='IcmFL'><q id='IcmFL'></q></dir></style></legend>