Technology Insights

Dynamic Styles with HTML, CSS, and Javascript

Styles can be dynamically changed in 4 ways: With Javascript (overrides all other styles)el = document.getElementById(‘pageBody’); el.style.backgroundColor = ‘red’; Inline styles (override both embedded and external styles)Inline styles are styles that are written directly in the tag on the document. Inline styles affect only the tag they are applied to. <a href=”” style=”font-size:91%;”> Embedded styles…