【问题标题】:Give two background colors to a div为 div 提供两种背景颜色
【发布时间】:2018-03-07 13:21:08
【问题描述】:

我想在我的 div .login-section 后面有两个不同的背景

示例 HTML:

<div class="login-container">
  <div class="login-section"></div>
</div>

我想为.login-container div 提供两种不同的背景颜色,如图所示

【问题讨论】:

  • 请阅读有关“How to Ask”和“minimal reproducible example”的指南,然后edit您的问题包括相关信息,例如您已经在使用的 HTML 和 CSS,以便我们可以重现您的问题以帮助您。

标签: html css twitter-bootstrap


【解决方案1】:

背景:线性梯度(0deg, rgba(255,255,255,1) 0%, rgba(255,255,255,1) 49%, rgba(5,193,255,1) 50%, rgba(5,193,255,1) 100%);

梯度生成器http://angrytools.com/gradient/

【讨论】:

    【解决方案2】:

    您可以使用线性渐变背景。

    .bg {
      height: 100vh;
      background: linear-gradient(#03a2e8 0%, #03a2e8 40%, #eeeeef 40%);
    }
    &lt;div class="bg"&gt;&lt;/div&gt;

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-07-05
      • 1970-01-01
      • 1970-01-01
      • 2013-08-23
      • 1970-01-01
      • 2017-09-08
      • 1970-01-01
      • 2018-05-04
      相关资源
      最近更新 更多