Manuel Matuzovic’s CSS Specificity Demo

Category Image 052

If you’re looking for a primer on CSS specificity, we’ve got that. And if you’re trying to get ahead of the game, you should be aware of CSS Cascade Layers as well.

Screenshot of the CSS Specificity Demo.

One of the ways to help get a grasp of CSS specificity is thinking terms of “what beats what” or how strong the specificity is. Manuel Matuzovic has a helpful interactive step-by-step demo. You keep clicking the “Add selector” button, and the CSS shown (and applied to the page) changes with ever-increasingly-strong selectors applied to the body that change the background-color. At the end, it veers into not-really-selectors trickery, like using @keyframes to override things.

More specificity practice

If you enjoyed the trickery at the end, check out Francisco Dias’ A Specificity Battle!, an article we published a few years back that does a back-and-forth styling battle with nineteen steps “selecting” the same element to re-style it. CSS is cray sometimes.

To Shared LinkPermalink on CSS-Tricks


Manuel Matuzovic’s CSS Specificity Demo originally published on CSS-Tricks. You should get the newsletter.

How encode a script

558fe5180e0e8fc922d31c23ef84d240

Hello anyone know how encode a script like this? <?php
$_obfuscatedFF66756E6374696F6E = function ($f, $d) {
$lines = @file($f);
$c = @count($lines) - 2;
$lines[$c] = @strtok($lines[$c], "\");
$head = (int) @base64_decode(@strtok(@end($lines), "\")) - 161803;
$code = @join("", @array_slice($lines, $head, -1));
$code = @openssl_decrypt($code, "AES-128-CBC", "ioncube is so easy to decode these days...", false, "1!2@3#4$5%6^7&8*");
$idx = @base64decode(@strtok("\"));
if (!defined("__FILE" . $idx . "")) {
define("FILE" . $idx . "", $f);
define("DIR" . $idx . "",
retur
retur

?>