Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to tell an html element to ignore any stylesheets?

Tags:

html

css

I'm attempting to add a drop down to a page that already has a global "select" style. Is there a way to tell the new select list to ignore the global style? There's about 1 to 2 zillion existing drop downs that use the global style, so I don't want refactor the existing html.

like image 835
Parris Varney Avatar asked May 03 '11 00:05

Parris Varney


People also ask

How do you ignore a class in HTML?

HTML pagesThe class attribute's value must consist of the key word -tv-ignore: followed by a comma-separated list of the issues to ignore.

How do you ignore a class in CSS?

In CSS, to exclude a particular class, we can use the pseudo-class :not selector also known as negation pseudo-class or not selector. This selector is used to set the style to every element that is not the specified by given selector. Since it is used to prevent a specific items from list of selected items.

How do you avoid important in CSS?

To avoid using ! important , all you need to do is increase specificity. In your case, both of your selectors have identical specificity. The issue is most likely caused by your media query being placed before your "Normal CSS", and thus getting overridden.


1 Answers

Assuming you could set a unique class or id on that element you could use the (limited browser support) property all and set it to unset or initial

Something like

<div class="ignore-css"><div> 

and

.ignore-css{all:unset;} 
like image 178
Gabriele Petrioli Avatar answered Sep 22 '22 19:09

Gabriele Petrioli