I have this JavaScript code that does createElement, but how can I style it from my separate CSS file?
JavaScript
emails.forEach(function(email) {
const element = document.createElement('div');
element.innerHTML = email.sender + ' ' + email.subject + ' ' + email.timestamp
document.querySelector('#email-container').append(element);
});
HTML
<div id="email-container">
</div>
CSS
#email-container .element{
border-width:2px;
border-style:solid;
border-color:black;
}