In my demonstration, I have set up a scenario where you will be required to establish two locations containing identical div contents - one designated for mobile devices (.mobile-content
) and the other for desktops (.desktop-content
).
The method of formatting involves ensuring that when the mobile version is visible, the desktop equivalent remains hidden, and vice versa. To toggle element visibility, you can utilize Bootstrap 4 classes like .d-x-none
and .d-x-block
.
All that remains is incorporating the clicking functionality when interacting with the circles......
For instance (best viewed in full-page mode):
.main-box {
text-align: center;
}
.circle{
flex-basis: 33%;
}
.circle img{
background: pink;
border-radius: 50%;
max-width: 100%;
}
.mobile-content{
flex-basis: 100%;
}
.desktop-content{
text-align: center;
}
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css">
<div class="main-box container-fluid d-flex justify-content-center flex-wrap flex-lg-nowrap">
<div class="circle px-2"><img src="https://dummyimage.com/200x200/4d204d/ffffff" /></div>
<div class="circle px-2"><img src="https://dummyimage.com/200x200/4d204d/ffffff" /></div>
<div class="circle px-2"><img src="https://dummyimage.com/200x200/4d204d/ffffff" /></div>
<div class="mobile-content p-2 d-lg-none">
<p>description goes here</p>
</div>
<div class="circle px-2"><img src="https://dummyimage.com/200x200/4d204d/ffffff" /></div>
<div class="circle px-2"><img src="https://dummyimage.com/200x200/4d204d/ffffff" /></div>
</div>
<div class="desktop-content p-4 d-none d-lg-block">
<p>description goes here</p>
</div>