π˜Ύπ™Žπ™Ž π™Žπ™šπ™‘π™šπ™˜π™©π™€π™§π™¨ 𝙂π™ͺπ™žπ™™π™š βœ…πŸ’™

βœ” Universal Selector
βœ” Class selector
βœ” Type selector
βœ” ID selector
βœ” Attribute selector

Many More...

π“π‘π«πžπšπ 🧡
π™ƒπ™šπ™‘π™‘π™€ π™—π™šπ™–π™ͺπ™©π™žπ™›π™ͺ𝙑 𝙃π™ͺ𝙒𝙖𝙣𝙨 πŸ‘‹

In this thread, we are going to cover basic CSS selectors with code examples.

Let's start πŸš€
πŸ“Œ What is CSS Selector?

CSS selector actually selects the content you want to style.

CSS provides different kinds of selectors to do this.
There are various types of selectors in CSS such as

βœ” Universal Selector
βœ” Class selector
βœ” Type selector
βœ” ID selector
βœ” Attribute selector
βœ” Group Selector

Let's Explore Each Selector πŸ˜‰πŸ‘‡
πŸ“Œ Universal Selector:-

The universal selector (*) works like a wild card selector. It will select all the elements of the page.

Or it matches elements of any type.

The below example will make all elements margin and padding β€˜0’. Image
We Mostly use the universal selector to reset default CSS.

Like this πŸ‘‡ Image
πŸ“Œ Class selector:-

This is one of the most used selectors of CSS.

It is declared with ( . ) followed by the class name.

This one Selects all the Html elements with the specific class. Image
πŸ“Œ Type selector:-

type selector is Also referred to as an β€œelement selector".

it selects one or more HTML elements, based on elements name.

The below example matches all <h1> elements, and change element color to red πŸ‘‡ Image
πŸ“Œ ID selector:-

The ID selector is declared using a hash [#] or pound symbol followed by the id attribute value.

An id is unique inside the page so it is chosen to select a single, unique element. Image
πŸ“Œ Attribute selector:-

Attribute selector allows you to select elements based on the attributes they contain,

As well as the values of those attributes.

Some common attribute selector syntax πŸ‘‡ Image
If you want to explore more about attribute selector then check this resource πŸ‘‡

developer.mozilla.org/en-US/docs/Web…
πŸ“Œ Group Selector:-

often we use some common styles for various elements.

With help of this selector, we can avoid duplication of code.

To do this, you just have to separate the selector's names with a comma (,)
and You are ready to use the same CSS styles on many elements. Image
There are other more complex CSS selectors available,

and we are going to cover those in the next thread.
Thanks for stopping and checking these resources,

I'm sure it's going to help you at some point in time.

Follow @Ali6nX404 for more such content.
If you liked this thread, you'll love my newsletter "CSS Crux".

Its ultimate goal is to simplify Complex CSS topics.

Check my profile and hit the subscribe buttonβœ…

β€’ β€’ β€’

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

Keep Current with Mahesh πŸ‘½πŸ›Έ

Mahesh πŸ‘½πŸ›Έ 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 @Ali6nX404

5 Dec
I wasted 2 months in tutorial hellπŸ˜–πŸ˜«

But WTF is Tutorial Hell? πŸ€·β€β™€οΈ

How to escape it?πŸ™„

Thread πŸ§΅πŸ‘‡
As I started learning to code, I was stuck in tutorial hell. It felt like, I am learning a lot of the stuff.

I have mastered CSS and JS.
After Creating a lot of projects while watching tutorials.

One day I decided to create a project of my own.
Read 21 tweets
4 Dec
When you read CSS code and find some weird code like :

-webkit-,
-moz-,
-o-,
-ms-

Let's understand about themβš‘πŸ‘‡
What we're going to cover:-

β—Ό What is the vendor prefix.
β—Ό Prefixes used by major browsers
β—Ό Why we Use?
β—Ό property supported by browsers or not
β—Ό How we can use vendor prefixes?
β—Ό automate the vendor prefix writing
πŸ“Œ What is the vendor prefix?

CSS properties starting with -webkit-, -moz-, -ms- or -o- are called vendor prefixes.

These are the vendor-prefixed offered by the relevant rendering engines.
Read 13 tweets
3 Dec
Level up your CSS With These Generators and tools✨

threadπŸ§΅πŸ‘‡ Image
1️⃣ This is the best generator to design your next project grid layout visually.

Copy the CSS code directly.
grid.layoutit.com
2️⃣ This Generator allows you to create complex shapes easily.

bennettfeely.com/clippy/
Read 11 tweets
2 Dec
CSS resources that always save my life πŸ˜…πŸš€

Thread πŸ‘‡
This thread is just a collection of resources that I use in my day-to-day work.

πŸ‘‡πŸ˜‰
1️⃣ CSS Tricks -

CSS tricks provide so much value through articles

And whenever I need to read about something deeply I prefer CSS tricks articles.

css-tricks.com
Read 10 tweets
22 Oct
Cheat Sheets that always save my time during development πŸš€

Thread πŸ‘‡
1️ HTML cheatsheet -
htmlcheatsheet.com
2️⃣ CSS cheat sheet -

htmlcheatsheet.com/css/
Read 10 tweets
21 Oct
Confused between boxes and box model πŸ™„πŸ€”

π˜‰π˜°π˜Ήπ˜¦π˜΄ - π˜‰π˜°π˜Ήπ˜¦π˜΄ 𝘳𝘦𝘀𝘡𝘒𝘯𝘨𝘢𝘭𝘒𝘳 π˜‰π˜°π˜Ήπ˜¦π˜΄ 𝘌𝘷𝘦𝘳𝘺𝘸𝘩𝘦𝘳𝘦 πŸ€·β€β™‚οΈπŸ˜…

Let's learn the most important concept 𝑩𝒐𝒙 𝑴𝒐𝒅𝒆𝒍 π’Šπ’ π‘ͺ𝑺𝑺.

Thread πŸ‘‡ Image
The first thing you need to understand is that,

Everything displayed is just a box.

Everything you see on a web page is made up of rectangles boxes.
on a website, you will see all the content is just a combination of boxes,

Arranged on top to, on next to, bottom, or nested in each other.

Header, nav, footer everything made up with boxes.

Usually, we called it HTML elements instead of rectangles boxes.
Read 21 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

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(