0
 <div class="row bg-white">
      <div class="col-lg-6">
      </div>
      <div class="col-lg-6">
      </div>
    </div>
    <div class="row bg-blue">
      <div class="col-lg-6">
          <div class="screenshot_water"></div>
      </div>
      <div class="col-lg-6">some text </div>
    </div>

I have 2 sections on the top of my website:

  1. white background
  2. blue background

What I want is for image to have 10% of it with a white background, and the rest blue.

Given that I have a row to deal with, how can I do this?

Blankman
  • 259,732
  • 324
  • 769
  • 1,199
  • 1
    Have you tried using gradient? https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Images/Using_CSS_gradients – Kavindra Apr 18 '18 at 02:02

2 Answers2

0

You could apply the CSS opacity property to the image.

.opaque {
  /* Theoretically for IE 8 & 9 (more valid) */
  /* ...but not required as filter works too */
  /* should come BEFORE filter */
  -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; // IE8

  /* This works in IE 8 & 9 too */
  /* ... but also 5, 6, 7 */
  filter: alpha(opacity=50); // IE 5-7

  /* Modern Browsers */
  opacity: 0.5;
}

You can read more about opacity at: https://developer.mozilla.org/en-US/docs/Web/CSS/opacity

Horacio Coronel
  • 432
  • 2
  • 6
0

Add overall in one main div

<div class="row bg-white-blue">
  <div class="col-lg-6"> </div>
  <div class="col-lg-6"> </div>
  <div class="col-lg-6">
    <div class="screenshot_water"></div>
  </div>
  <div class="col-lg-6">some text </div>
</div>

And then add CSS to that main div class. For example

.bg-white-blue {
  background: linear-gradient(black 10%, blue 50%);
}
Joshua
  • 3,055
  • 3
  • 22
  • 37
Vidya
  • 126
  • 9