diff --git a/_includes/figure.liquid b/_includes/figure.liquid index 9087dd929961..48ff465d88a2 100644 --- a/_includes/figure.liquid +++ b/_includes/figure.liquid @@ -38,17 +38,21 @@ {% else %} height="auto" {% endif %} - {% if include['min-width'] %} - min-width="{{ include.min-width }}" - {% endif %} - {% if include['min-height'] %} - min-height="{{ include.min-height }}" - {% endif %} - {% if include['max-width'] %} - max-width="{{ include.max-width }}" - {% endif %} - {% if include['max-height'] %} - max-height="{{ include.max-height }}" + {% if include['min-width'] or include['min-height'] or include['max-width'] or include['max-height'] %} + style=" + {% if include['min-width'] %} + min-width: {{ include.min-width }}; + {% endif %} + {% if include['min-height'] %} + min-height: {{ include.min-height }}; + {% endif %} + {% if include['max-width'] %} + max-width: {{ include.max-width }}; + {% endif %} + {% if include['max-height'] %} + max-height: {{ include.max-height }}; + {% endif %} + " {% endif %} {% if include.alt %} alt="{{ include.alt }}"