V
V
vik73352018-04-06 18:19:40
Layout
vik7335, 2018-04-06 18:19:40

How to make such a block on bootstrap 4?

I can't figure out how to type. I can separately for desktop and separately for mobile devices. But so that when the screen is reduced, the desktop version looks like the version for mobile devices, I can’t figure out how best to do this. I'm afraid to write a crutch. This is the desktop version.
5ac78e02ae633032994771.png
and this is what the version for mobile devices looks like
5ac78f67e05ef279763348.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
Talyan, 2018-04-06
@vik7335

I, too, after a long hibernation, did not know this.
The essence of media queries.
Google it.
The meaning is this:
in CSS write:

.item {
width:100%;
}

/* а тут создаете условие для итема */

@media (max-width:500){

.item {
width:50%;
}

}

and for the tiles to be divided as you have - google CSS Grid - with the help of grids, you can arrange the tiles as you like. Accordingly, in the media query, specify the new location and that's it. If the screen size is less than a certain one, the media query condition and the CSS code inside it will be executed.
Do not forget to specify the scale of the mobile phone screen, otherwise the phone will stretch the page like on the desktop.
<!-- Mobile Specific Meta -->
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

M
Maxim Timofeev, 2018-04-06
@webinar

getbootstrap.com/docs/4.0/components/card/#card-columns

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question