0

I am working on a website that already has general properties on the <table> tag element (in the whole website).

So if I add a table in a specific page after building it on a blank html page, it gets the properties of the global <table>.

How do I reset it's properties of the table element just for this specific page?

When adding the code ansered in this post:

Reset/remove CSS styles for element only

to my table class... for example:

.ext{
*here*
}

<table class="ext"> 
 ...... 
</table>

It has too many properties that makes it worse to run over the older properties.

I'm sure there is a better way to do these kind of stuff. Please help.

Community
  • 1
  • 1
Imnotapotato
  • 5,308
  • 13
  • 80
  • 147
  • 1
    Are you able to set the style properties as `!important` in the `.ext { }` ? – Ben Clarke Dec 17 '15 at 15:25
  • The default CSS rules inherited from the browser can only be overridden by other rules declared by the site. There are many [relatively concise reset stylesheets](http://cssreset.com/scripts/eric-meyer-reset-css/) out there. – Boaz Dec 17 '15 at 15:26
  • You could utilize [Shadow DOM](http://www.html5rocks.com/en/tutorials/webcomponents/shadowdom-201/) –  Dec 17 '15 at 15:30
  • Why don't you just define the CSS properties for `table.ext`? You probably only need a handful of properties at most and the rest (those not being used) can stay as is. – Marc Audet Dec 17 '15 at 15:32
  • I can, but I have other stuff like background properties that don't display the background because if this.@BenClarke – Imnotapotato Dec 17 '15 at 15:36
  • I just don't think there is a practic solution for this :S – Imnotapotato Dec 17 '15 at 15:37
  • If you are saying about the browser defaults than look at CSS reset stylesheets, they are all over the web, those stylesheets reset each elements properties to a standardized value. Few Examples http://meyerweb.com/eric/tools/css/reset/ http://html5doctor.com/html-5-reset-stylesheet/ (CSS Reset With HTML5 Elements Included) – Stefan Neuenschwander Dec 17 '15 at 15:42
  • Yeah I know about these.. the problem is when you have properties like background, colors, vertically align, ect. I just thought there is something much easier and time saving to do in these situations. – Imnotapotato Dec 17 '15 at 15:50

1 Answers1

3

In the web, there are a lot of files that have all the configuration and all the css properties set to default, just use one and see the results.

You can see an overview here: http://cssreset.com/

Christoph
  • 50,121
  • 21
  • 99
  • 128
Jack1987
  • 727
  • 1
  • 14
  • 26