Priya_garg Profile picture
Jun 21 โ€ข 8 tweets โ€ข 3 min read
Basic understanding of CSS Specificity -

Understanding this concept is necessary to have control over your HTML and CSS.

A Thread๐Ÿงต๐Ÿ‘‡
What is CSS Specificity?

๐Ÿ‘‰ Basically, it is a set of rules applied to CSS selectors to determine which style is applied to an element.

๐Ÿ‘‰ A CSS selector that is used to target an element determines the degree of specificity.
How do we determine which style is more specific?

โ— Inline styles - 1,0,0,0

โ— ID - 0,1,0,0 (#id)

โ— Class, pseudo-class and attribute - 0,0,1,0 (.class, :hover, [type="text"])

โ— Elements - 0,0,0,4 (h1,p)

Here take a look at this - Image
CSS Specificity rules :

1. Inline style vs External/Internal Styling -

๐Ÿ‘‰ Inline styles(added to an element directly in the HTML code with the style attribute)

๐Ÿ‘‰ Inline style will always beat both external and internal styles because of its high specificity. Image
2. Id selector vs Class selector -

๐Ÿ‘‰ Since Id has more specificity than class, then id selector will override class style wherever you place it in the stylesheet. Image
3. Multiple Selectors having equal specificity -

๐Ÿ‘‰ When CSS selectors have equal specificity, styles are being passed down from top to bottom. Image
โšกTip :-

The best way to determine why your style is being overridden is to inspect the element in your browser.

You can view each element's style using Chrome Dev Tools' Styles tab.

For a specific element, tab shows which specific styles are applied and which are overridden.
That's the end of the thread.

If anyone still doubts anything, drop your queries ๐Ÿ’ฌ๐Ÿ‘‡ or DMs are open.

Follow @priya_garg2 to see content like this, also likeโค the first tweet and retweet๐Ÿ” first tweet to share it with your audience.

Thank you๐Ÿ˜Š

โ€ข โ€ข โ€ข

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

Keep Current with Priya_garg

Priya_garg 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 @priya_garg2

Jun 22
To make your next web development project more successful, here is a list of the top 5 tools for frontend development.

A Thread๐Ÿงต๐Ÿ‘‡ Image
1. Creative Tim - creative-tim.com

๐ŸŒ€ It is a BootStrap-based front-end web development tool.

๐ŸŒ€ It provides an extensive toolkit of UI elements, easy-to-use templates, and dashboards. Image
2. Visual Studio Code - code.visualstudio.com

๐ŸŒ€ It is a free open source code editor created by Microsoft for Windows, macOS, and Linux operating systems.

๐ŸŒ€ It offers a wide variety of packages and free extensions for any added functionality. Image
Read 7 tweets
Jun 11
Basic Git commands to upload a project on GitHub -

Every developer must know these 10 basic commands.

A Thread๐Ÿงต๐Ÿ‘‡
If you don't know, what is Git?

Then, clear your confusion from this thread.
1. Configuration -

โ—‰ Used to set up the author's name, email, file format, etc.

โ—‰ The โ€“global flag tells Git that this name and email will be used across all local repositories.

โ—‰ Use them from the beginning, so your name will be displayed in your contribution history.
Read 13 tweets
Jun 5
Found some awesome Portfolio Ideas for web developers -

You can get an idea to build your own๐Ÿ‘‡
1. Lounge Lizard - loungelizard.com

๐Ÿ‘‰ This portfolio is build by New York based design company .

๐Ÿ‘‰ This website looks professional and difficult to build at the same time .

๐Ÿ‘‰ But this website will definitely helps you to grab anyone's attention.
2. Matthew Williams - findmatthew.com

๐Ÿ‘‰ It is a single page with a black background and clean interface.

๐Ÿ‘‰ If you want to make a creative front end developer portfolio with a beautiful interface, then you canโ€™t miss this one.
Read 7 tweets
Jun 4
What are variables in JavaScript ?

Let's understand them with examples๐Ÿงต๐Ÿ‘‡
Why do we need variables ?

๐Ÿ‘จโ€๐Ÿ’ป In programming , We know there is a lot of data processing .

๐Ÿ–ฅ We may need to store that data before or after processing for future use.

โ“Then , here arise a question?

๐Ÿค”Where to store that data, right ?

โœ” And variables solves this problem.
What are variables ?

๐Ÿ‘‰ Variables are basically used to store little pieces of data to use later on.

Example-
Read 11 tweets
Jun 1
Awesome helpful websites for every developers :-

A๐Ÿงต๐Ÿ‘‡
1. Readme.so - readme.so/editor

It will assist you in creating a good format README file for your open source project.
2. Meta Tags - metatags.io

Your HTML file should include different meta tags so your
website will be compatible with different platforms.

This website helps you automatically generate these meta tags.
Read 7 tweets
May 31
Git is the most essential thing to learn as a programmer.

Let's understand it an easy way ๐Ÿงต๐Ÿ‘‡
๐Ÿข Let's assume you work for a Gaming company .

๐ŸŽฎ And you are asked to build a new Gaming app .

๐Ÿ‘จโ€๐Ÿ’ป You are not building this project alone but with a team of 4-5 developers.

โ“ Here arise a question ?
๐Ÿค” How will you work with the team and write the same code as them on the same code base without causing conflict ?

So that's where Git comes in .

๐Ÿคทโ€โ™€๏ธ What is Git ?

๐Ÿ‘‰ It is a distributed version control system .
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

Don't want to be a Premium member but still want to support us?

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!

:(