Originally posted by: mattlear
Originally posted by: Nocturnal
Ok so in this case the .img img would only normally be used within the div class="img" am I correct or would it also affect the other elements that just bare the img tag? Like outside of this img class, say there is another <img******> tag some where, would that too be affected by the border?
No. it would not affect img tags outside the .img class.
Check out my example I mentioned earlier... it doesn't affect img tags outside of the class scope.
Also, keep in mind that order of declaration matters in CSS - but remember that specificity also matters as well.
So, if you had flipped jjones' example, it would STILL do what he described.
The first statement applies to everything with an img class name.
The second css declaration is more specific - namely,
it only applies to img tags that are contained in the .img class block. Those img tags in the block get the second rule applied, effectively overwriting the first rule when in conflict.
-Matt