diff --git a/Change_Color_Background/css/style.css b/Change_Color_Background/css/style.css index 463dc06..3845613 100644 --- a/Change_Color_Background/css/style.css +++ b/Change_Color_Background/css/style.css @@ -1,3 +1,7 @@ button { - margin-top: 50vh + margin-top: 50vh margin-left: 80px; + color: yellow; + + + } \ No newline at end of file diff --git a/Change_Color_Background/js/script.js b/Change_Color_Background/js/script.js index ea46b78..a5832f2 100644 --- a/Change_Color_Background/js/script.js +++ b/Change_Color_Background/js/script.js @@ -3,10 +3,10 @@ const button = document.querySelector('button') const body = document.querySelector('body') const colors = ['red', 'green', 'blue', 'yellow', 'pink', 'purple'] -body.style.backgroundColor = 'violet' +body.style.backgroundColor = 'Yellow' button.addEventListener('click', changeBackground) -function changeBackground(){ -const colorIndex= parseInt(Math.random()*colors.length+1) -body.style.backgroundColor = colors[colorIndex] +function changeBackground() { + const colorIndex = parseInt(Math.random() * colors.length + 1) + body.style.backgroundColor = colors[colorIndex] }