Use start width for item not working in IE

I have a graphic plugin that inserts a canvas and a <table> legend into its contents. Width is not specified in this table plugin, and in my CSS, the width for the tables inside this container was inserted into my plugin.

So, the new div inherits table{ width: 100%} from CSS and makes it wrong.

I tried using width: initial; , looks good in Chrome, but IE doesn't like to check browser compatibility

I admit changing / forcing inline CSS into the script / plugin, as it should work in any environment.

What is the best solution here?

+81
css cross-browser internet-explorer width
Dec 29 '13 at 7:38
source share
2 answers

As you said, usually width: auto will have a similar effect. Availability of rules:

 .my-selector { width: auto; width: initial; } 

Must force it to use initial , if supported, and auto otherwise.

+140
Mar 11 '14 at 10:53
source share

Using width: auto; inline, the script solves the problem in Chrome, FIrefox and IE 11. Just not sure if there is a better way.

+4
Dec 29 '13 at 7:58
source share



All Articles