I'm a beginner in web design and I'm wondering if it's possible to adjust the font-size
of the card-title and the size of the card image based on different screen sizes using bootstrap 4. When viewed on small screens, they appear too large.
https://i.sstatic.net/Ar2tW.png
Below is my HTML code:
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-10">
<img class="card-img-top-a mx-auto d-block mt-5" src="img/a.png">
<h5 class="card-title text-center mt-5 font-weight-bold">Pixel perfect design</h5>
<p class="card-text px-auto text-justify">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-10">
<img class="card-img-top mx-auto d-block mt-5" src="img/b.png">
<h5 class="card-title text-center mt-5 font-weight-bold">Design Targeted</h5>
<p class="card-text px-auto text-justify">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-10">
<img class="card-img-top mx-auto d-block mt-5" src="img/c.png">
<h5 class="card-title text-center mt-5 font-weight-bold">Finalize a FSL</h5>
<p class="card-text px-auto text-justify">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
Here is an example of my CSS code where I manage p{}
.
Do I need to do the same for card-title
, or is there another way to approach this?
@media (min-width: 0px) { p{font-size: 0.7rem;}}
@media (min-width: 576px) { p{font-size: 0.6rem;}}
@media (min-width: 768px) { p {font-size: 0.8rem;}}
@media (min-width: 992px) { p {font-size: 0.8rem;}}
@media (min-width: 1200px) { p {font-size: 1rem;}}
What should I do regarding images for different screen sizes?
.card-img-top{
width: 80px;
height:80px;
}
Thank you for your guidance!