Utilizing Bootstrap 4 along with a custom CSS file on my website.
Within the CSS file, I have included some media queries at the bottom:
@media (max-width: 575px) {
.address .contact {
text-align: center;
}
}
/* Small devices (tablets, 768px and up) */
@media (min-width: 768px) {
}
/* Medium devices (desktops, 992px and up) */
@media (min-width: 992px) { }
/* Large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) { }
@media screen and (min-width:768px) and (max-width:992px){
.left{
margin-left: 0;
width: 100%;
}
.picto{
width: 40%;
}
}
Included below is an excerpt of code:
<section id="section_address" class="container">
<div class="row">
<div class="col-12 col-sm-6">
<div class="address">
<h5>ADDRESS</h5>
1 street,<br>
75000, PARIS
</div>
</div>
<div class="col-12 col-sm-6">
<div class="contact">
<h5>MYCOMPANY</h5>
01 11 22 33 44<br>
<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="35565a5b4154564175584c565a5845545b4c1b565a58">[email protected]</a><br>
<a href="http://mycompany.com" target="_blank">http://mycompany.com</a>
</div>
</div>
</div>
</section>
However, my media queries seem to not take effect unless I include !important
on each line. This goes against my previous experience as I've never had to use it before.