Having an issue with my code snippet below. The internal stylesheet's element styles (img {height: !important;}
) are overriding the inline style on the img tag (style="height:200px;
). What could be causing this?
Wondering if there might be a misunderstanding in CSS order or processing, or if something else is missing.
Code Sample
img { height:auto !important }
<img src="https://placehold.it/200x200" width="200" height="200" align="left" border="0">
<img src="http://placehold.it/1x1" height="200" width="9" alt="" align="left" border="0" style="height: 200px;">
<p>Lorem Ipsum cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Cras tortor turpis, iaculis eu convallis a, pellentesque vitae enim. Fusce commodo vehicula nulla, sit amet congue lacus adipiscing a. Vivamus at convallis nibh. Proin felis turpis, aliquet eu arcu aliquam, accumsan consectetur justo. Vestibulum sit amet arcu quis neque gravida vulputate ut quis sem. Curabitur a metus lacus. Mauris non dolor vitae massa viverra lobortis ut convallis diam. Fusce eu tempor dolor, vitae imperdiet ipsum.</p>
Other notes
Understand that adding !important to the img may solve the issue, but why should it be necessary?
Acknowledging that this is not an ideal solution and align
is deprecated. Yet, as it's for an HTML email format, compromises have to be made.