Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Two tone style background

I just need to style two-tone color background like this.

I tried and successfully did using linear gradient

background: linear-gradient(172deg, #ECB034 50%, #BE883C 50%);

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

But it has a problem when resizing web page. It just not well aligned to its corners. Showing weirdly. Like this

enter image description here

is there any way to did this?

.cta{
  padding: 60px 0;
  background: linear-gradient(172deg, #ECB034 50%, #BE883C 50%);
  text-align:center;
}

.cta h3{
  font-size: 58px;
  margin-bottom: 30px;
  font-weight: 700;
}

.cta a{
  padding: 16px 49px;
  border: 2px solid #000;
  color: inherit;
  font-size: 20px;
  text-transform: uppercase;
  display: inline-block;
  font-weight: 500;
}
    <div class="cta text-center">
      <div class="container">
        <h3>Let’s talk about your project.</h3>
        <a href="">Get Started ></a>
      </div>
    </div>

enter image description here

>Solution :

This is a very simple fix with an SVG (as I mentioned in the comments) you simply need to add preserveAspectRatio="none" to the SVG tag and run it through a URL encoder. This one will even generate the CSS for you which is quite nice.

.cta{
  padding: 60px 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='100%25' width='100%25' preserveAspectRatio='none' viewBox='0 0 10 10'%3E%3Crect width='10' height='10' fill='%23ECB034' /%3E%3Cpath d='m0 10 h10 v-10' fill='%23BE883C' /%3E%3C/svg%3E");
  text-align:center;
}

.cta h3{
  font-size: 58px;
  margin-bottom: 30px;
  font-weight: 700;
}

.cta a{
  padding: 16px 49px;
  border: 2px solid #000;
  color: inherit;
  font-size: 20px;
  text-transform: uppercase;
  display: inline-block;
  font-weight: 500;
}
<div class="cta text-center">
      <div class="container">
        <h3>Let’s talk about your project.</h3>
        <a href="">Get Started ></a>
      </div>
    </div>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading