To achieve your desired outcome effectively on the mobile version of your website, it's important to consider alternative approaches. For instance, instead of using the margin attribute directly which can disrupt your responsive layout on mobile devices, you can add a supplementary attribute like
@media (min-width:768px){ 'your-class'{margin:0}}
to override the previous margin.
An effective method is to nest your class within your preferred div and then apply the desired margin option to your class.
Here's an example:
<div class="container">
<div class="col-md-3 col-xs-12">
<div class="events">
<img src="..." class="img-responsive" alt="...."/>
<div class="figcaption">
<h2>Event Title</h2>
<p>Event Description.</p>
</div>
</div>
</div>
<div class="col-md-3 col-xs-12">
<div class="events">
<img src="..." class="img-responsive" alt="...."/>
<div class="figcaption">
<h2>Event Title</h2>
<p>Event Description. </p>
</div>
</div>
</div>
<div class="col-md-3 col-xs-12">
<div class="events">
<img src="..." class="img-responsive" alt="...."/>
<div class="figcaption">
<h2>Event Title</h2>
<p>Event Description. </p>
</div>
</div>
</div>
</div>
To implement the margin option, simply add it to your class in the CSS as shown below:
.events{
margin: 20px 10px;
}
This approach ensures proper spacing between your divs without compromising the functionality of your website on mobile and tablet devices.