2Answers
  • 7
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191

Backtrace:

File: /home/prodcxja/public_html/questions/application/views/question.php
Line: 191
Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php
Line: 433
Function: view

File: /home/prodcxja/public_html/questions/index.php
Line: 315
Function: require_once

name Punditsdkoslkdosdkoskdo

Using * with :not in css

I'm working on an HTML linter using CSS.

Reference: https://bitsofco.de/linting-html-using-css/

I like the idea of highlighting elements that have inline styles like so:

*[style] {
    color: red !important;
    border: 5px solid red !important; 
}

However, I do have certain instances where I have to use inline styles, ie canvas elements.

  1. How do I use the: not selector with the *?
  2. Can I have multiple :not, ie :not(canvas):not(form), etc

What you have worked and excludes the canvas. And yes, you can chain multiple: not()s like that.

* {
  border: 1px solid black;
}

*[style]:not(canvas):not(form) {
    color: red !important;
    border: 5px solid red !important;
}

HTML:

<canvas style="foo">canvas</canvas>
<form style="foo">form</form>
<div style="foo">div</div>
  • 4
Reply Report

the: not() rule matches anything not matching the subrule. The subrule is a valid css selector. writing [canvas] will match any element with a canvas attribute, so this isn't what you want.

The correct usage is:

*[style]:not(canvas):not(form)
  • 4
Reply Report

Trending Tags