Looking to dynamically update the contents of a div
element by adding two material icons side by side.
To test this, I created a simple fiddle that demonstrates what I am trying to achieve: https://jsfiddle.net/zog20r7n/3/
When attempting to modify line 36
, which currently contains:
<i class=\"material-icons \" >account inbox</i>
to:
<i class=\"material-icons md-mine\" >account inbox</i>
The first icon ends up being aligned to the right of the second icon. It also seems like upon clicking the button for the first time, the icons are misaligned on the page and the second one appears centered on a new line.
If anyone can shed some light on why this is happening and provide a solution, it would be greatly appreciated. I've tried adjusting the CSS thinking it might be the cause, but without success so far.