Gtk2HTML: Div margins, width and heights

The following example renders a DIV element inside an HTML element:

require 'requestor'
eval Requestor.read('http://rorbuilder.info/r/ruby'){|x| x.require 'gtk2html' }


s =<<EOF
<html>
  <style>
    * {background-color: green;
    margin: 0.5em;
    padding: 0;
    font-size: 1.3em;
    color: red}
    div {background-color: orange;}
  </style>
  <div style="height: 10em"></div>
</html>
EOF


Gtk2HTML::Main.new s, irb: true

Here's a screenshot of the Gtk2App rendering the above HTML.

Screenshot of the Gtk2HTML application

Notes:

  1. When running the same HTML in a web page in Firefox, there is apparently no margin for the HTML element
  2. The unit size of an em in pixels seems to change depending upon the font size.