Z
Z
Zbiten2018-10-05 20:56:53
css
Zbiten, 2018-10-05 20:56:53

How to swap blocks with css?

There is this block:

How to turn it into this on mobile devices:
5bb7a5d26cdc9336666928.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Ankhena, 2018-10-06
@Zbiten

It's funny, but the easiest way to solve this is on floats
https://codepen.io/anon/pen/mzrPoa
The order option is possible, but it's confusing with the current markup.
And then it is more convenient in the reverse order.
The image should go first, then the title and text.
They are lined up using columns in 2 columns.
And when in one column, then already order.

A
Andrey_Hmytron, 2018-10-06
@Andrey_Hmytron

I would do it via position: absolute;
Something like this:

.box {
    max-width: 700px;
    position: relative;
    padding: 30px 30px 30px calc(50% + 20px);
    .image {
      position: absolute;
      left: 0;
      top: 0;
      width: 50%;
      height: 100%;
      overflow: hidden;
    }
  }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question