I'm trying to generate a list of dynamic items (jQuery) and the css of the dynamic content is not matching the static content, could someone point out what is wrong?
the first 3 items are static, each with a small space between, the next 3 are dynamic and Don't have any spacing between
Note: both are linked to the same CSS
Static Implementation:
<div class="car-preview">
<img src="https://www.google.com/photos/about/static/images/google.svg">
<div class="car-details">
<p>Holden Commodore Blah Blah
<br><span>$10000</span></p>
<ul>
<li>10000km Driven</li>
<li>1.5L 4Cyl Petrol Engine</li>
</ul>
</div>
</div>
Dynamic Implementation:
$(document).ready(function() {
for(var i = 0; i < 3; i++){
$(".filter-content").html($(".filter-content").html()
+ '<div class="car-preview">'
+ '<img src="https://www.google.com/photos/about/static/images/google.svg">'
+ '<div class="car-details">'
+ '<p>Holden Commodore Blah Blah<br><span>$10000</span></p>'
+ '<ul>'
+ '<li>10000km Driven</li>'
+ '<li>1.5L 4Cyl Petrol Engine</li>'
+ '</ul>'
+ '</div>'
+ '</div>');
}
});
I've been stuck on this for a while now,
Thanks in advance for any help.