Skip to content

Commit

Permalink
Center images
Browse files Browse the repository at this point in the history
  • Loading branch information
edongashi committed Nov 22, 2023
1 parent a28da8a commit b696a6f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion _includes/image.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
{% assign max_width = include.max_width | default:"" %}

{% if src != "" %}
<img src="{{ src }}" alt="{{ alt }}" class="img-fluid" {% if max_width != "" %}style="max-width: {{ max_width }}; width: 100%;"{% endif %}>
<img src="{{ src }}"
alt="{{ alt }}"
class="img-fluid mx-auto d-block"
{% if max_width != "" %}style="max-width: {{ max_width }}; width: 100%;"{% endif %}>
{% else %}
<p class="error">Error: Missing 'src' attribute in include 'image.html'.</p>
{% endif %}

0 comments on commit b696a6f

Please sign in to comment.