Technical Article
59 views0 likes

CSS Media Queries

Abel Gideon
September 23, 2025
about 1 month ago

Media Queries in CSS
Ever wondered how websites are built across different devices with different screen sizes? that's the job of media queries. A very powerful feature in CSS that allow us to apply styles based on the characteristics of the user's device, such as screen size, resolution and orientation.

Simply put, media queries are used to style websites based on their sizes.

The way a website looks or structured on your typical laptop screen is not the same on your phone's screen.

Making a website look great and fit for different screen sizes is what we call "responsiveness".

let's look at some basic use of media queries:

  1. For screens smaller than 768px

`@media (max-width: 768px) {

body {

background-color: lightblue;

}

}`

  1. For screens larger than 768px

`@media (min-width: 769px) {

body {

background-color: lightgreen;

}

}`

  1. For landscape orientation

`@media (orientation: landscape) {

body {

font-size: 18px;
}
}`

  1. For portrait orientation

`@media (orientation: portrait) {

body {

font-size: 16px;
}
}
`

It is very important that your website is responsive because your target users will use different devices with different sizes to access your site.

#keeplearning
#keepbuilding
#webdev
![image](C:\Users\VALOUR\Desktop\DeepTech\posts\post 7a.JPG)
![image](C:\Users\VALOUR\Desktop\DeepTech\posts\post 7b.JPG)

Last updated: October 24, 2025

Written by: Abel Gideon

More Articles

Deep Technology's

We are on an unwavering mission to be Nigeria's most loved software company, helping people discover new problem-solving strategies to solve problems around the globe.

NO 33 Democracy Crescent, Gaduwa Estate Gudu,Abuja FCT, Nigeria

© 2025 Deep Technology's. All rights reserved.