Forum:CSS for pre element

Hello,

I added the following css in my wiki:

It worked pretty well, however the background color and border color were not changed. If you detect the problem, please let me know.

Penguin-Pal  (talk)  18:59, August 12, 2012 (UTC)


 * Your CSS is valid, but it's possible it was overridden by rules somewhere else - can you link to your wiki? Also, unrelated to that, you can condense your padding values into a single rule:.


 * Thanks for the padding tip. My wiki is here.
 * Penguin-Pal  (talk)  19:19, August 12, 2012 (UTC)


 * Either use "!important" or define the stylings for ".WikiaArticle pre".--PedroM (talk) 19:53, August 12, 2012 (UTC)


 * should be avoided whenever possible. Using the selector  is the better solution.


 * Thanks! it now works.
 * Penguin-Pal  (talk)  19:58, August 12, 2012 (UTC)


 * Why is that?--PedroM (talk) 20:23, August 12, 2012 (UTC)


 * causes a rule to completely ignore specificity. That's "bad" because it breaks the "cascading" part of "Cascading Style Sheets", interrupts the flow of the stylesheet, and makes the stylesheet harder to maintain in the future. This article gives a good explanation.
 * Thanks for the link.--PedroM (talk) 21:24, August 13, 2012 (UTC)