add style javascript
// Bad: element.setAttribute("style", "background-color: red;"); // Good: element.style.backgroundColor = "red";
add style javascript
// Bad: element.setAttribute("style", "background-color: red;"); // Good: element.style.backgroundColor = "red";
js style
const title = document.querySelector('h1') //title.setAttribute('style', 'margin: 50px'); console.log(title.style); // Show all style propertyes console.log(title.style.color); // Log a color in console title.style.margin = '50px'; // Set a margin of title title.style.color='crimson'; // Set a color of title title.style.fontSize = '60px'; // Set font size of title
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us