Visual test to see different ways to apply dimensions to image.

Using 128 x 128 emoji images for tests, 240 x 512 zmdi-attachment-alt (thin image), 2304 x 1792 fa-cc-jcb (wide image).

Examples of calculated width and height for zmdi-pause.
SVG size is 256 x 512, so width/height ratio is 0.5
Code Width Height Sample Explanation
No values <i class="simple-svg" data-icon="zmdi-pause"/> 0.5em 1em If attributes are missing, height is set to 1em.
Width is calculated using SVG width/height ratio.
Using one attribute <i class="simple-svg" data-icon="zmdi-pause" height="16px"/> 8px 16px Width is calculated using width/height ratio.
Wrong width/height ratio <i class="simple-svg" data-icon="zmdi-pause" width="32px" height="32px"/> 32px 32px Even though dimensions have different aspect ratio than SVG, image will not be distorted.
Image will be scaled down to fit and centered inside 32 x 32 square.
Using one attribute <i class="simple-svg" data-icon="zmdi-pause" data-width="2em"/> 2em 4em Height is calculated using SVG width/height ratio.
Using one attribute <i class="simple-svg" data-icon="zmdi-pause" data-width="32" width="16"/> 16px 32px Width takes priority over data-width.
Height is calculated using SVG width/height ratio.
"auto" in attribute <i class="simple-svg" data-icon="zmdi-pause" width="auto"/> 256 512 too large to show Width is set to original SVG width.
Height is calculated using SVG width/height ratio.
css with "auto" <i class="simple-svg" data-icon="zmdi-pause" style="width: auto; max-width: 100%"/> 0.5em,
broken in IE
1em,
broken in IE
Image will behave differently in Internet Explorer (up to MS Edge 12) than in other browsers.
>Never use keyword "auto" in width or height in inline style or css.

How image dimensions are handled by SimpleSVG:
- You can set dimensions using width and height attributes (<svg width="16px" height="16px").
   If one dimension is set, another one is set automatically by SimpleSVG using width/height ratio of original SVG image.
   For example, fa-apple size is 1408 x 1792. If you set height="16", width will be automatically set to 20.37 (1792 / 1408 * 16), keeping same width/height ratio as in original image.
- You can also use data-width and data-height attributes. They are aliases for width and height attributes, checked if width or height attributes are missing.
- If width and height attributes are missing, height is set to 1em, width is set to (svg width / svg height)em.
- If width or height attribute (attribute - not css rule!) is set to "auto", dimensions will be set to original svg dimensions.
- You can set dimensions using stylesheet or inline style attribute, but these dimensions will not be parsed by SimpleSVG.
   Never use keyword "auto" when setting SVG width or height via stylesheet or inline style. Internet Explorer (MS Edge 12) cannot handle it.


Tests using only height:

Tests using only width:

Both width and height:

Automatic dimensions:

Best way to set dimensions for SVG? Either use both width and height or use (data-)height attribute.

NEVER set width to auto in CSS, it will mess up layout in Internet Explorer.