diff --git a/htmlcssguide.html b/htmlcssguide.html index 8bab67a..ba283fe 100644 --- a/htmlcssguide.html +++ b/htmlcssguide.html @@ -693,6 +693,27 @@ color: #eebbcc; color: #ebc; +
Avoid using !important
declarations.
These declarations break the natural cascade of CSS and make it difficult to +reason about and compose styles. Use +selector specificity +to override properties instead.
+ +/* Not recommended */
+.example {
+ font-weight: bold !important;
+}
+
+
+/* Recommended */
+.example {
+ font-weight: bold;
+}
+
+
Avoid user agent detection as well as CSS “hacks”—try a different approach @@ -713,8 +734,8 @@ frequently.
Alphabetize declarations.
-Put declarations in alphabetical order in order to achieve consistent code in a -way that is easy to remember and maintain.
+Put declarations in alphabetical order in order to +achieve consistent code in a way that is easy to remember and maintain.
Ignore vendor-specific prefixes for sorting purposes. However, multiple vendor-specific prefixes for a certain CSS property should be kept sorted (e.g.