This project is read-only.

How to set CSS style in typescript

Topics: Language Specification
Feb 27, 2014 at 10:54 PM
first i tried: = "position:absolute;overflow:hidden;width:100%;height:100%;top:0;left:0";
but it gives this error:
error TS2012: Cannot convert 'string' to 'MSStyleCSSProperties':
Type 'String' is missing property 'pixelWidth' from type 'MSStyleCSSProperties'.
then i tried:
node.setAttribute('style', 'position:absolute;overflow:hidden;width:100%;height:100%;top:0;left:0;border:1px solid black;');
and this worked.
Feb 28, 2014 at 4:56 PM
One may set styles individually = "absolute"; = "hidden";
// etc
or all at once = "position:absolute;overflow:hidden;width:100%;height:100%;top:0;left:0";
BTW the question should really be "How to set CSS style in JavaScript".