2

everybody!

Reading this topic: Change background color of HTML <area> tag

I saw the part of a CSS code:

area{
    sharedAttr: 'attribute';
}

I wonder what is this sharedAttr. What is amazing Google search:

css sharedAttr

gives only 8 (eight!) results. I can not find any documentation mentioning anything about usage of sharedAttr in css sheet. Can anybody shed some light on the topic?

Thank you in advance!

Community
  • 1
  • 1
Paweł Tokarz
  • 326
  • 2
  • 15
  • The only relevant search results are links to that answer, so I'm not sure what to call it. It's definitely not a valid CSS property. – Blender Apr 27 '13 at 10:30
  • 1
    To me it looks like 'sharedAttr' is just a placeholder in this guys example code. – Michael Krupp Apr 27 '13 at 10:30

1 Answers1

1

The example you referenced is alluding (albeit rather poorly) to the fact that you can define one or more CSS properties using a fairly generic selector and then use a more restrictive selector to define specific additions/overrides.

area{
    /* matches all instances of the area element, so properties 
       that should be applied to all area elements go here */
}

#one {
   /* properties which should only be applied to the element 
      with the ID "one" go here */
}

In context of the original question, such a technique is commonly used to reduce the number of styles that must be declared. If 100 area tags all need the same background color, it would be silly to define a selector for each one. However, additional selectors can be defined to override that color and/or define additional properties on certain elements.

Tim M.
  • 53,671
  • 14
  • 120
  • 163
  • Ok, I get the idea of dafining properties for all tags 'area' and to add/overwrite some properties for id'ed ones, but the question is not about the technique, but what's the sharedAttr. Is this a placeholder as keks said? – Paweł Tokarz Apr 27 '13 at 15:42
  • Yes. It's not a real CSS property; they were just using an example. – Tim M. Apr 27 '13 at 19:46