A CSS bookmarklet that puts pink error boxes (with messages in comic sans) everywhere you write bad HTML.

Related tags

CSS REVENGE.CSS
Overview

REVENGE.CSS

The premise of revenge.css is simple: A CSS bookmarklet that uses selectors to find bad markup, displaying ugly pink error messages in comic sans serif wherever you write bad HTML. If you activate the bookmarklet and the page gets lots of pink blotches, the author has included at least one of the following:

  • Misplaced <div>s
  • Deprecated elements
  • Malformed hyperlinks
  • Inaccessible forms
  • Empty elements
  • Inaccessible images
  • Missing ARIA landmarks
  • Badly authored sectioning elements
  • Erroneous lists
  • Obsolete attributes

Try the bookmarklet

GitHub won't let me use javascript in my README. Pretty sensible. Go to the new hot pink, skull-festooned demo page.

Comments
  • li[role=

    li[role="separator"] shouldn't be recommended since it's invalid

    One of your error messages is:

    Do not use list items to divide up lists unless they have role = separator

    However <li role="separator"> is invalid per http://www.w3.org/TR/html5/dom.html#sec-implicit-aria-semantics :

    • Language feature: li element whose parent is an ol or ul element
    • Restrictions: If specified, role must be one of the following: listitem, menuitem, menuitemcheckbox, menuitemradio, option, radio, tab, treeitem or presentation

    Note how separator is absent from that list.

    Perhaps presentation should be recommended instead?

    opened by cvrebert 6
  • Wrong `img` rule

    Wrong `img` rule

    I believe there is a rule matching all correctly formated images:

    img[alt]:not([alt=""])
    

    This targets all img tags with an alt attribute which is not empty. So... Every properly formated image as far as I know. I believe you want to target:

    img[alt=""]
    

    ... but you might want to override this rule for images in figure, because it's common practice to empty the alt attribute when there is a figcaption.

    opened by KittyGiraudel 3
  • Recommendation: sr-only class in Twitter Bootstrap

    Recommendation: sr-only class in Twitter Bootstrap

    I find the sr-only class used for off-screen screen reader only text used in sites. Often it is used unnecessarily. For example: <h2 class=”sr-only”> This is the site header</h2>. I recommend including the following to flag this. .sr-only:after{ content: 'Off-screen text for screen reader users. Is this text necessary?' !important; }

    opened by LaurenceRLewis 2
  • Move to `::after`

    Move to `::after`

    Since you don't aim at supporting IE 8 based on the number of :not() occurrences, I think you could move all the :after to ::after to stick to the specifications.

    No big deal, just a minor improvement.

    opened by KittyGiraudel 2
  • Update README.md

    Update README.md

    Hi I am working on an assignment for a technical writing course. We were asked to edit the writings on GitHub randomly. I came across your README.md file and edited a minor thing. I think with this fix your writing will be grammar error free. Thank you

    opened by saharjs 1
  • Fix typos ( including https://github.com/Heydon/REVENGE.CSS/pull/14 ).

    Fix typos ( including https://github.com/Heydon/REVENGE.CSS/pull/14 ).

    Pull request fixes two typos;

    1. contentinfo => banner (as per https://github.com/Heydon/REVENGE.CSS/pull/14 , by @Conalclos )
    2. footer => header (also required)
    opened by jibbius 0
  • Clarify the keyboard focus warning

    Clarify the keyboard focus warning

    The warning is confusing if the developr has set the tabindex properly. I strongly agree on using proper HTML elements, but we still have another warning that is more specific and clear to developers.

    opened by denis-sokolov 0
  • Add version to bookmarklet

    Add version to bookmarklet

    I'd love to see some indication of which version I've got stored on my bookmarks bar, compared to the current master version. Is it possible to add a version near the beginning of the bookmarklet code?

    i.e. javascript:(function(){'1.0.0';revenge=document.createEleme... or javascript:(function(){version='1.0.0';revenge=document.createEleme... ?

    I realise that the bookmarklet is just a way to link in the .css, but it still wouldn't hurt to have a version present.

    opened by GaryJones 0
  • DL permits DIV as direct child since

    DL permits DIV as direct child since "HTML5" and adjacent DTs and DDs

    https://github.com/Heydon/REVENGE.CSS/blob/1fdbe2c0bce82cc588ef16541ec368a6d4baa300/revenge.css#L62

    Sure this style predates HTML5 and HTML Living Standard, so hard to criticize, but nowadays it is allowed to have non-nested DIV elements inside DL:

    https://html.spec.whatwg.org/multipage/grouping-content.html#the-dl-element:concept-element-content-model

    https://github.com/Heydon/REVENGE.CSS/blob/1fdbe2c0bce82cc588ef16541ec368a6d4baa300/revenge.css#L63

    Also AFAIK it newer was a mistake to have multiple definitiondescription therms defscribed by one or more DD.

    So such sample should suffer no revenge:

    <dl>
      <div>
       <dt>foo</dt>
       <dt>bar</dt>
       <dt>baz</dt>
       <dd>Very common metasyntactic variables.</dd>
       <dd>Frowned-upon words without meaning often seen in programming handbooks.</dd>
      </div>
      <div>
        <dt>metasyntactic variable</dt>
        <dd><q cite="https://en.wikipedia.org/wiki/Metasyntactic_variable">specific word or set of words identified as a placeholder in computer science and specifically computer programming</q></dd>
      </div>
    </dl>
    
    opened by myfonj 2
  • Is the message suggesting ”Forms must have action attributes” still relevant?

    Is the message suggesting ”Forms must have action attributes” still relevant?

    Arrived here from @brucelawson's 10/12/19 post (https://www.brucelawson.co.uk/2019/checklist-to-avoid-the-most-common-accessibility-errors/) where he recommends this bookmarklet for checking certain common accessibility errors.

    Similar to the issue he logged (#25), is the “Forms must have action attributes” still relevant?

    HTML5 spec https://www.w3.org/TR/html52/sec-forms.html#element-attrdef-submitbuttonelements-formaction:

    The action and formaction content attributes, if specified, must have a value that is a valid non-empty URL potentially surrounded by spaces.

    'If specified' as in 'optional'? This answer on StackOverflow seems to think so (https://stackoverflow.com/questions/9401521/is-action-really-required-on-forms). According to them it was required in HTML4 but not in HTML5 and can be left off. So if doctype is HTML5 there is no need for the action attribute?

    opened by paulyabsley 0
  • Time to retire the message suggesting role=

    Time to retire the message suggesting role="banner" to header elements, now?

    .. pretty sure this is obsolete in today's browsers? (Ditto contentinfo etc). Happy to make a PR ..

    (and perhaps show a message on any main that is not the only/ first main on a page, because 8.06% of pages erroneously contain more than one main landmark (https://almanac.httparchive.org/en/2019/accessibility#main-landmark)

    opened by brucelawson 2
  • Img Link Reported as empty

    Img Link Reported as empty

    https://www.forkliftsmi.com

    <a class='fl printHide' href='/'><img id='Logo' alt='Forklifts of Michigan' src='/images/logos/ForkliftsMichiganLogo.png'/></a>

    opened by miwebguy 0
Owner
Heydon Pickering
Heydon Pickering
A Bootstrap HTML homepage template with feature boxes - created by Start Bootstrap

Start Bootstrap - Heroic Features Heroic Features is a multipurpose HTML template for Bootstrap created by Start Bootstrap. Preview View Live Preview

Start Bootstrap 160 Nov 27, 2022
A classless CSS framework to write modern websites using only HTML.

new.css new.css A classless CSS framework to write modern websites using only HTML. It weighs 4.8kb. All it does is set some sensible defaults and sty

null 3.6k Jan 3, 2023
Reseter.css - A Futuristic CSS Reset / CSS Normalizer

Reseter.css A CSS Reset/Normalizer Reseter.css is an awesome CSS reset for a website. It is a great tool for any web designer. Reseter.css resets all

Krish Dev DB 1.1k Jan 2, 2023
Write your resume in Markdown online.

Oh, Resume! Word and LaTex are too overkill for a resume. So why not write it in Markdown? Have fun: oh-resume.zxh.io WIP Notice Highly recommend usin

Xiaohan Zou 42 Dec 24, 2022
The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.

Bootstrap Sleek, intuitive, and powerful front-end framework for faster and easier web development. Explore Bootstrap docs » Report bug · Request feat

Bootstrap 161k Jan 1, 2023
Material Design Components in HTML/CSS/JS

Material Design Lite An implementation of Material Design components in vanilla CSS, JS, and HTML. Material Design Lite (MDL) lets you add a Material

Google 32.1k Jan 4, 2023
Simple CSS library for semantic HTML markup

awsm.css awsm.css is a simple CSS library for semantic HTML, which doesn't require classes, ids, attributes, etc. Just start to create page with HTML5

Igor Adamenko 1.4k Dec 30, 2022
RxHtmlButtonLibrary - Html Button Styling Library by roxunlimited.com using CSS and jQuery.

rxHTMLButton Library v0.3 rxHTMLButton Library will work on almost every HTML tag. It will smoothly work on 'a href link', 'button type button', 'inpu

roxunlimited 0 Sep 16, 2022
A pure html and css library for dark mode in your website.

Dark Mode A pure html and css library for dark mode in your website. Features It has a smooth setting and also it changes via system settings aswell.

null 1 Jan 6, 2022
The fastest way to build beautiful Electron apps using simple HTML and CSS

Photon UI toolkit for building desktop apps with Electron. Getting started Clone the repo with git clone https://github.com/connors/photon.git Read th

Connor Sears 9.9k Dec 29, 2022
Giggy is a collection of a few fun jokes related to Coding & Dark Humor - Created using HTML, JavaScript, CSS & Webpack.

Giggy A Collection of some of the best jokes. This is a Web Application with some jokes related to coding & Dark Humor. Created with data from the Jok

Awais Amjed 7 Jul 28, 2022
A small codebase to simulate environment of a real software engineering job built using html/css/js

How to setup your development environment? Before you can begin, you will need git, node, and a text editor. If you are running Windows, we recommend

JobSimulator 89 Dec 21, 2022
Spectre.css - A Lightweight, Responsive and Modern CSS Framework

Spectre.css Spectre.css is a lightweight, responsive and modern CSS framework. Lightweight (~10KB gzipped) starting point for your projects Flexbox-ba

Yan Zhu 11.1k Jan 8, 2023
Low-level CSS Toolkit – the original Functional/Utility/Atomic CSS library

Basscss Low-level CSS toolkit – the original Functional CSS library https://basscss.com Lightning-Fast Modular CSS with No Side Effects Basscss is a l

Basscss 5.8k Dec 31, 2022
Framework-agnostic CSS-in-JS with support for server-side rendering, browser prefixing, and minimum CSS generation

Aphrodite Framework-agnostic CSS-in-JS with support for server-side rendering, browser prefixing, and minimum CSS generation. Support for colocating y

Khan Academy 5.3k Jan 1, 2023
CSS Boilerplate / Starter Kit: Collection of best-practice CSS selectors

Natural Selection Natural Selection is a CSS framework without any styling at all. It is just a collection of selectors that can be used to define glo

FrontAid CMS 104 Dec 8, 2022
Source code for Chrome/Edge/Firefox/Opera extension Magic CSS (Live editor for CSS, Less & Sass)

Live editor for CSS, Less & Sass (Magic CSS) Extension Live editor for CSS, Less & Sass (Magic CSS) for Google Chrome, Microsoft Edge, Mozilla Firefox

null 210 Dec 13, 2022
Easily create css variables without the need for a css file!

Tailwind CSS Variables This plugin allows you to configure CSS variables in the tailwind.config.js Similar to the tailwindcss configurations you are u

Mert Aşan 111 Dec 22, 2022
Cooltipz.css - A highly customisable, minimal, pure CSS tooltip library

Cooltipz.css - Cool tooltips Cool customisable tooltips made from pure CSS Lightweight • Accessible • Customisable • Simple Cooltipz.css is a pure CSS

Jack Domleo 110 Dec 24, 2022