7 Popular CSS Selectors To Know

A thread 🧵
🔹Universal Selector

The universal selector matches all the elements in a HTML document

It is represented by an asterisk (*)

* {
...
}
🔹Type Selector

The type selector matches all the elements specified in a comma- delimited list.

It allows you specify the same styles to several elements

h1, h2, h3 {
...
}
🔹Class Selector

The class selector allows you to match a rule with element(s) carrying a class attribute whose value matches the one you specify in the class selector.

this...

.main {
...
}
🔹Id Selector

The class selector allows you to match a rule with an element carrying an id attribute whose value matches the one you specify in the class selector.

this...

#main {
...
}
🔹Child Selector

The child selector matches an element that is a direct child of another.

In this case it matches any < b > elements that are direct children of < td > elements

td > b {
...
}
🔹The Descendant Selector

This matches an element that is a descendant of another specified element (or nested inside another specified element), not just a direct child.

table b {
...
}

Here, it matches any element that is a child of the element
🔹Adjacent Selector

An adjacent sibling selector matches an element type that is the next sibling of another.

If you want to make the first paragraph after any h1 a different style from other elements you can use the adjacent sibling selector like so:

h1+p {
...
}
These selectors offer you good ways to reference your elements.

If you liked this thread, follow me 👉 @UbahTheBuilder for similar ones on web development.

Also, you might want to check out this course:

gumroad.com/a/834147443

• • •

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

Keep Current with Kingsley Ubah

Kingsley Ubah 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 @UbahTheBuilder

19 May
7 VSCode extensions to improve productivity as a web developer

Thread below 🧵
🔹LIVE SERVER

Live Server sets up a local development server with a live reload feature for previewing your site

Every time you save your code, you'll instantly see the changes on the browser

marketplace.visualstudio.com/items?itemName…
🔹ICON FONTS

Icon Fonts offers snippets for a variety of icon fonts, including the popular Font Awesome v5 icon pack.

marketplace.visualstudio.com/items?itemName…
Read 10 tweets
18 May
7 GitHub Repositories all web developers should know

Thread below 🧵
🔹33 JS CONCEPTS

This repository contains 33 concepts that every JavaScript developer should know. It is a very useful repository for both newbie and experienced JavaScript developers to strongly grasp the basics of JavaScript

github.com/leonardomso/33…
🔹 AWESOME CLEANSHEETS

Cleensheets are very useful resources which contains huge amount of information on a specific topic.
This repository has got cheatsheets for basically everything — from frontend libraries to backend and even databases.

github.com/LeCoupa/awesom…
Read 9 tweets
17 May
The quickest way to learn JavaScript is by having the right resources.

Here are some good resource to learn JavaScript.

🧵
🔹JavaScript Prototype - 🔗 freecodecamp.org/news/a-beginne…

🔹ES6 - 🔗 w3schools.com/js/js_es6.asp

🔹Variable Scoping - 🔗 w3schools.com/js/js_scope.asp

🔹JavaScript Closures - 🔗 developer.mozilla.org/en-US/docs/Web…
Read 5 tweets
11 May
Complete roadmap for learning the key concepts in CSS

Thread below 🧵
CSS flexbox - 🔗
CSS Inheritance and Cascade - 🔗 developer.mozilla.org/enUS/docs/Lear…
CSS Units - 🔗 w3schools.com/cssref/css_uni…
CSS Selectors - 🔗 w3schools.com/cssref/css_sel…
CSS Grids - 🔗
CSS Colors - 🔗 w3schools.com/cssref/css_col…
CSS Functions - 🔗 w3schools.com/cssref/css_fun…
CSS Properties - 🔗 tutorialrepublic.com/css-reference/…
CSS Box Model - 🔗
CSS Block formatting - 🔗 developer.mozilla.org/en-US/docs/Web…
CSS Box Sizing - 🔗 w3schools.com/css/css3_box-s…
Read 5 tweets
10 May
How to handle Impostor Syndrome as a developer 🧵

~thread~
" If Mr X, a well renowned and highly educated professional could make this kind of mistake and still bounce back then you have a chance"

What I do is that I motivate myself from the mistakes/failures of other experts in the past.

If these people failed, then who am I?
Ask for help.

Whether it's a fellow developer on social media or a team member at work.

Opening up to someone about your feelings can be very helpful as he/she is most likely to give you words of encouragement in hopes of allaying your doubts and motivating you.
Read 6 tweets
29 Apr
8 basic JavaScript concepts to know as a Beginner

Thread below 🧵
🔹Events

JS is an event-driven language. There is an action/event from the user to trigger your script to run.

You define an event handler that will run when a particular event eg click, hover etc is triggered.

There are many DOM Event methods and Properties to learn
🔹Variables

Variables are containers of data. It's important to learn about identifiers like let, const and var. Also understand the different data types:

✅String
✅Number
✅Boolean
✅ Arrays
✅ Objects
...
Read 11 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!

:(