silexlabs / Cocktail

An HTML/CSS rendering engine for the Haxe language
http://www.silexlabs.org/haxe/cocktail/
Other
192 stars 34 forks source link

SUB and SUP #FIXED #398

Open Espigah opened 10 years ago

Espigah commented 10 years ago

(didn't work for me) sub { vertical-align: sub } sup { vertical-align: super }

(solution) sub, sup {vertical-align: baseline; position: relative; font-size: 70%;} sub {bottom: -0.6em;} sup {top: -1.0em;}

yanhick commented 10 years ago

Thanks for the tip. Vertical-align is not fully implemented, this is one of the trickiest features to implement from CSS 2.1

FYI, the current implementation can be found here : https://github.com/silexlabs/Cocktail/blob/master/cocktail/core/linebox/LineBox.hx#LC712

Espigah commented 10 years ago

(Y) ok I forgot to tell you where I changed > DefaultCSSStyleSheet

Espigah commented 10 years ago

Pure as3: (worked fine) var cssRules:String = "sub, sup {vertical-align: baseline; position: relative; font-size: 70%;} sub {bottom: -0.6em;} sup { top: -1.0em; }"; var myStyle:CSSStyleSheet = new CSSStyleSheet(cssRules, PropertyOriginValue.USER_AGENT); document.addStyleSheet(myStyle);