A
A
Abra Kadabra2015-03-07 23:15:45
css
Abra Kadabra, 2015-03-07 23:15:45

Is it possible to make non-standard backgrounds in responsive design? Is it worth it at all?

Recently I was asked to make the site adaptive, this is how some blocks in the design look like:
Mobile version.
af838304929c4adb9a7a5bb3bbe6b4f2.jpg
Tablet version.
1102afae272f4e08905964c09575de14.jpg
As you can see, all the blocks there are arrows that are directed downwards.
How can this be implemented so that the arrows look normal in both the mobile version and the PC?
How I tried: I
made blocks of the usual shape, which I set a rectangular background, but with a cropped arrow. After that, each block was connected and received arrows.
With different ones
background-cover
- when the coverbackground stretched and the arrows were cut off (disappeared, because the picture was stretched)
- containwhite space appears on the sides of the background.
Such solutions are not suitable.
What would you do in such a case?
How can this be implemented, or at least simulated implementation? (So ​​that the arrows fall into place)

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Mikhail Goryachkin, 2015-03-07
@Jmaster

You can try to do it with transformations.
Here's a quick example I sketched:

<div class="treangle">
  <div class="treangle--left"></div>
  <div class="treangle--right"></div>
</div>

CSS:
body, html {
  height: 100%;
  width: 100%;
}
.treangle {
  width: 100%;
  height: 100%;
  position: relative;
  background-color: #000;
  overflow: hidden;
  
  [class*='treangle--'] {
    width: 100%;
    height: 50%;
    position: absolute;
    background-color: yellow;
  }
  
  .treangle--left {
    float: left;
    left: -50%;
    transform: rotate(20deg);
    transform: matrix(-1, -0.2, 0, 1, 0, 0);
  }
  
  .treangle--right {
    float: right;
    right: -50%;
    transform: rotate(-20deg);
    transform: matrix(1, -0.2, 0, 1, 0, 0);
  }
}

Everything will resize as it should. It's just a matter of browser support.
Working example.

V
Vladimir Shiklgruber, 2015-03-08
@mnjghgmjyt

media queries.

M
Moris Haos, 2017-12-19
@Austin1

Hello,
First they install Windows, leaving the necessary space for the subsequent installation of Linux, since Windows overwrites Grub during installation and installs its own bootloader.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question