Pratham Profile picture
8 May, 14 tweets, 3 min read
Complete introduction of CSS media queries for beginners

Thread 🧡
The biggest misconception among beginners are they think that media queries are for making a website responsive.

Though that's the one use case of media queries. You can use them modifying your site according to device media type. Let's see this in bit more details
Media types describe the general category of a device.

They are useful when you want to modify your site or app depending on a device's general type (such as print vs. screen) or specific characteristics and parameters (such as screen resolution or browser viewport width).
Let's see the media types first πŸ‘‡πŸ»

1. all
2. Print
3. Screen
4. Speech
There are some deprecated media types as well but they are not in use nowadays like tty, tv, projection, embossed, aural etc...
Alright moving forward, next thing we need to understand is media features.

As the tern suggests, they are features of a particular media. They specifies the characteristic of the output device.

For example, width, height, color, aspect-ratio etc...
I hope this helped you understand that media queries are not just to make websites responsive. Although this is the biggest use case of media queries. when I was first learning it, I found some difficulties. Let see how can we use it in order to create a responsive website πŸ‘‡πŸ»
Let's start with the syntax first (See attached image)
Let's see an example into action. So that we can build strong hold on the concept

"""
@ media screen and (min-width: 600px) {
div {
background: green;
}
}
"""

In this case the background will be green whenever the screen width is 600px of greater than 600px;
You can also combine two media features using "And", "Not" or ","

For example:

"""
@ media screen and (min-width: 600px) and (max-width: 900px) {
div {
background: green;
}
}
"""

In this case, the background will be green between 600px to 900px width
You can try bunch of media features

- any-hover
- color
- height
- width
- grid
- aspect-ratio
- orientation
- resolution, etc...
We can also write the nested media queries:

When min-width = 600px and user hover over element then solid black will create around div.
You can check my other thread if you want to learn more about how to make website responsive

I guess that's pretty much it for quick overview. I hope you like it. Share this thread with your connection if you like it ❀️

Peace out πŸ˜‰

β€’ β€’ β€’

Missing some Tweet in this thread? You can try to force a refresh
γ€€

Keep Current with Pratham

Pratham Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @Prathkum

10 May
Algorithms and data structures are always the most complicated and confusing parts of programming

But DS and Algo are important and can reduce your efforts and help you solve the problem in a quick and efficient manner

Some great visualizers will solve all your doubts πŸ§΅πŸ‘‡πŸ»
1️⃣ cs.usfca.edu/~galles/visual…

- Learn DSA and visualize some complex programs. Definitely check it out.
2️⃣ clementmihailescu.github.io/Pathfinding-Vi…

- Dedicated to graph DS
Read 6 tweets
9 May
If you start with the right course then the process becomes a little easier

I found some amazing YouTube videos and courses that will help you start your Web Development journey

πŸ§΅πŸ‘‡πŸ»
HTML and CSS

- A great way to arouse your web dev journey with Gary's (@designcoursecom) course on YouTube

πŸ”— Image
JavaScript

- Although it's impossible to learn JavaScript in 2 hours but JavaScript mastery is one the best YouTube chanel for JavaScript. This 2 hours long crash course will help you start your journey and gives you quick overview.

πŸ”— Image
Read 6 tweets
9 May
6 beginner friendly websites that will boost your HTML and CSS learning process πŸš€

πŸ§΅πŸ‘‡πŸ»
1️⃣ Learn HTML

- The easiest way to learn HTML & CSS. Learn HTML provides an interactive tutorial that explains how to build HTML & CSS websites step by step.

πŸ”— learn-html.org Image
2️⃣ HTML best practice

- A very well written document on HTML best practice

πŸ”— hail2u.github.io/html-best-prac… Image
Read 7 tweets
7 May
11 great websites a programmer should visit

Thread πŸ§΅πŸ‘‡πŸ»
Can I use?

- A website that provides up-to-date browser support tables for support of front-end web technologies on desktop and mobile web browsers.

πŸ”— caniuse.com
Web Skills

Websites for all kind of learning resources for web developers

- Fundamentals
- Accessibility
- Web components
- Progressive web apps
- Frameworks and libraries
- Testing
- Architecture and Paradigm
- UI and UX
- DS and Algo

πŸ”— andreasbm.github.io/web-skills/
Read 12 tweets
7 May
I joined Tech Twitter 11 months ago and during this time I made around 72K audience.

Everyone can do this. Let me share how 🧡
1️⃣ Find your niche

Evaluate your passions and skills. And share something in the community in which you are good at. This is how you can let the people know that new member joined in the community recently

This is how I started πŸ‘‡πŸ»
2️⃣ Use big accounts smartly 😎

I have noticed many people tag big accounts in their tweet in order to get impressions. This is not the right thing.

You can reply on the posts of big accounts and by doing so there might be some chances of getting impressions on your reply....
Read 16 tweets
7 May
7 amazing websites that will help you improve your CSS skills

πŸ§΅πŸ‘‡
1️⃣ Learn to code HTML and CSS

- Learn how to build beautiful and intuitive websites by way of clear and organized lessons

πŸ–‡οΈ learn.shayhowe.com
2️⃣ CSS reference

- CSS Reference is a free visual guide to CSS. It features the most popular properties, and explains them with illustrated and animated content

πŸ–‡οΈ cssreference.io
Read 8 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!

:(