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

Why is Dreamweaver finding my ID instead of my Class?

Advocate ,
Dec 27, 2017 Dec 27, 2017

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?

581
Translate
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

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

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
Translate
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

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

Specificity - CSS | MDN

Translate
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

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.

Translate
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

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
Translate
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

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.

Translate
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

Oh, I see (sort of) .

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
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

wow

Translate
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
LATEST

May CSS be with you

Translate
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