11
Let’s assume I have some CSS of the type:
#foo input {
background-color: black;
color: white;
/* seguem mais um milhão de propriedades */
text-align: center;
z-index: 9000;
}
All input
son of foo
will have all these properties.
Supposing in the middle of the page I want a single input
does not have this formatting... I know I can give you a specific class or id with new formatting rules. But only what I specify will be overwritten. I have to play a value initial
in all properties already specified previously to be able to undo them all.
Is there any shorter way to ignore CSS for just a snippet of the page? I would love something like:
<!-- aqui acaba o CSS -->
<input blablabla />
<!-- aqui o CSS começa a valer de novo -->
Or
<input blablabla ignoreCss="True"> <!-- seria tão bom se houvesse algo assim -->
Or else
$("#idDoMeuInput").ignoreCssCompletely();
I have looked for several alternatives in several places but could not find them. Is there any way to make an element ignore CSS?
Ignore no. But by Javascript it is possible to remove all styles of an element, I just don’t find it very practical.
– bfavaretto
You can use iframes, and completely create another page outside and insert it!
– user92134