Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Why is Dreamweaver finding my ID instead of my Class?

Advocate ,
Dec 27, 2017 Dec 27, 2017

Copy link to clipboard

Copied

Why when I select a div I give a class and id to, then select my css under source, why is the selector showing the id instead of the class. Shouldn't it be showing the class in order for me to make changes in css?

Views

569
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Dec 27, 2017 Dec 27, 2017

to complete what said Nancy, just take a look there, we call that Specificity

Specificity - CSS | MDN

Votes

Translate
Community Expert ,
Dec 27, 2017 Dec 27, 2017

Copy link to clipboard

Copied

ID has priority because it's unique to the page.

Class carries less importance.

What are you trying to do?

Nancy O'Shea— Product User, Community Expert & Moderator

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 27, 2017 Dec 27, 2017

Copy link to clipboard

Copied

to complete what said Nancy, just take a look there, we call that Specificity

Specificity - CSS | MDN

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Dec 29, 2017 Dec 29, 2017

Copy link to clipboard

Copied

Let's tie this in with the latest Star Wars hype!

specificitywars-05v2.jpg

PS the latest movie is really as bad as people are saying. Bombing a dreadnought in a no-gravity environment? And have they never heard of cruise missiles in the SW universe? Based on the self-destruct mission by one of the last tactical minds left in the rebellion (why is the general going down in her ship, when a droid could have sufficed, or perhaps have it remotely controlled?) a couple of cheap cruise missiles with installed hyper drives could pretty much destroy any opponent's ship at almost any size!

Sigh.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 29, 2017 Dec 29, 2017

Copy link to clipboard

Copied

rayek.elfin  wrote

Let's tie this in with the latest Star Wars hype!

specificitywars-05v2.jpg

PS the latest movie is really as bad as people are saying. Bombing a dreadnought in a no-gravity environment? And have they never heard of cruise missiles in the SW universe? Based on the self-destruct mission by one of the last tactical minds left in the rebellion (why is the general going down in her ship, when a droid could have sufficed, or perhaps have it remotely controlled?) a couple of cheap cruise missiles with installed hyper drives could pretty much destroy any opponent's ship at almost any size!

Sigh.

Huh?  What in the universe has any of this to do with CSS IDs and Classes?

Nancy O'Shea— Product User, Community Expert & Moderator

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Dec 29, 2017 Dec 29, 2017

Copy link to clipboard

Copied

The chart expands on your answer. It's meant as a fun way to explain CSS specificity. The emperor represents an #ID selector, who is stronger in the force (specificity) than Darth Vader.

Too bad no-one expanded this chart with inline/external css rules and the !important statement. An inline !important CSS rule would be akin to the Death Star.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 29, 2017 Dec 29, 2017

Copy link to clipboard

Copied

Oh, I see (sort of) .

Nancy O'Shea— Product User, Community Expert & Moderator

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 29, 2017 Dec 29, 2017

Copy link to clipboard

Copied

wow

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 29, 2017 Dec 29, 2017

Copy link to clipboard

Copied

LATEST

May CSS be with you

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines