Would my CSS file have issues if I put syntax for Firefox, Chrome, and IE all into the same file? Or dynamically print out the appropriate syntax based on the browser?
CSS: Is it ok to put multiple Browser syntax into one file?
Collapse
X
-
Tags: None
-
-
Well since Mozilla and WebKit are really the only "Browsers" out, since IE, as it is basicly the most used browser out there and the least featured... like doing this:Code:filter: progid: DXImageTransform.Microsoft.gradient( startColorstr=#FFFFFFFF, endColorstr=#FF339900 ); background: -moz-linear-gradient( 0% 100% 90deg, #fff, #390 ); background: -webkit-gradient( linear, 0% 0%, 0% 100%, from(#fff), to(#390) );
Comment
-
There is no problem inserting whatever you'd like into CSS, as the CSS-parsers only fail if a declaration isn't well-formed. This is CSS that neither make a CSs-parser crash, nor style the element:
Code:element { give-color-to-background: red and blue; }
Comment
-
It will produce a warning but it should skip to the next declaration.
If you were to make separate stylesheets for each browser that would be an additional call to the server for each stylesheet.
It is perfectly safe to put them all in one.Comment
Comment