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

How make this background blue properly?

Good morning,
I need to reproduce this shape but I don’t know how to reproduce the blue background properly.
do you have any idea? the absolute position doesn’t suit me because it’s a responsive image.
For the image, I used the rotate property :

  .content {
  display: flex;
  .image {
    flex: 0 0 50%;
    img {
      transform: rotate(85deg);
    }
    @include media-screen-lg {
      padding-left: 24px;
      padding-right: 0;
    }
  }
<div class="content">
  <div class="text"></div>
  <div class="image">
    <img src={{content.field_image}}>
  </div>
</div>

enter image description here

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

>Solution :

for a single child/container , you may use width,background and rotate:

example

.image {
  background: blue;
  width: max-content;/*shrinks to image's width */
  margin: 3em;
}

img {
  rotate: 5deg
}
<div class="image">
  <img src="https://dummyimage.com/520x550">
</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