bool const haveheight = !params().height.zero();
if (havewidth || haveheight) {
if (havewidth)
- imgstyle += "width:" + params().width.asHTMLString() + ";";
+ imgstyle += "width: " + params().width.asHTMLString() + ";";
if (haveheight)
- imgstyle += " height:" + params().height.asHTMLString() + ";";
+ imgstyle += " height: " + params().height.asHTMLString() + ";";
} else if (params().scale != "100") {
- // Note that this will not have the same effect as in LaTeX export:
- // There, the image will be scaled from its original size. Here, the
- // percentage will be interpreted by the browser, and the image will
- // be scaled to a percentage of the window size.
- imgstyle = "width:" + params().scale + "%;";
+ // The `scale` CSS property is supposed to be used for responsive
+ // designs, but it behaves mostly as LyX. The only problem is that
+ // the image's bounding box is not scaled. (As opposed to a width,
+ // which is a percentage of the HTML container: the meaning of the
+ // percentage is completely different, but the bounding box has the
+ // right size.)
+ imgstyle = "scale: " + params().scale + "%;";
}
if (!imgstyle.empty())
imgstyle = "style='" + imgstyle + "' ";