Is there a way to ignore styles written in parent tags?

Is there a way to ignore all written styles and start from scratch for a new tag. For example, if I wrote a style

table {
  large amount of styles..
}

and then I want to start a new table without any styles with something like this

<table style="no style">

I can write another class for the new table and apply the class, but the problem is that there are so many styles to override. Is there such an attribute?

+3
source share
5 answers

Unfortunately no, there is no "reset" element. This is one of the reasons why it is not recommended to wash ultra-high-shape elements. This can become a problem later when you want to change it. You have two options.

  • create a class instead and give all existing tables this class.
  • .
+5

. :

table.complex-styling {
  large amount of styles..
}
+3

css css3 :not():

table:not(.no_style) {
    large amout of styles
}

table.no_style. css3 .

+3

"large amount of styles"?

:

@paul... ... , - , ( ) -, style . - rubyprince

, , table, .

To find out what the default value for each property is, see How can I invalidate the css property?

Case study: http://jsfiddle.net/nE4qm/

table {
    font-size: 20px;
    color: red;
    margin: 20px;
    position: relative;
    left: 30px;
    text-align: center;
    border: 1px solid #000
}
.removeStupidTableCSS {
    font-size: medium;
    color: #000;
    margin: 0;
    position: static;
    left: auto;
    text-align: left;
    border: 0
}
.myShinyNewTable {
    color: blue
}

<table>
    <tr>
        <td>Old table</td>
    </tr>
</table>

<hr />

<table class="removeStupidTableCSS myShinyNewTable">
    <tr>
        <td>New table</td>
    </tr>
</table>
+2
source

No, and I would like to. Unfortunately, rewriting parental styles is the only way to go.

0
source

All Articles