Search code examples
jqueryhtmlcsswordpresscurly-braces

CSS display:none; if content:"}";


I have this incredibly irritating curly brace that I can't get rid off.

I have a WordPress website running and installed a plugin.
This plugin adds a right-curly brace } at the top of the page.
Directly below the <body>

I went through the entire plugin-pages but couldn't find it. Now I would like to hide it with some CSS, but the curly brace has no class or id or whatever.

I tried the following:

body{
  content:"}";
  display:none;
}

But obviously that just clears out the entire page.

Any ideas?


Solution

  • A plain old Javascript solution would be to test for a node of type TEXT_NODE at the first index and to make sure its text is exactly { - I've trimmed whitespace as an example, but perhaps you don't need to.

    var firstChild = document.body.childNodes[0];
    if(firstChild && firstChild.nodeType === 3 && firstChild.textContent.trim() === "{") {
        document.body.removeChild(firstChild);
    }
    

    jsFiddle example