با استفاده از css flex و media query، دو div را با قابلیت responsive در کنار یکدیگر قرار دهید.
html 1 2
html
css #main { display: flex; } #c1 { background-color: blue; flex: 1; height: 100px; } #c2 { background-color: red; flex: 1; height: 100px; } @media screen and (max-width: 740px) { #main { display: block; } }
css
js