Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fixed the page's css using javascript!
  • Loading branch information
kmr18006 committed Mar 5, 2024
1 parent 1e5f10c commit 6448cea
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions js/fix-the-page.js
Expand Up @@ -4,16 +4,23 @@
*/

// 1) Add CSS Properties to the body tag

document.body.style.fontFamily = "'Trebuchet MS', sans-serif"
document.body.style.fontSize = "10pt"
document.body.style.color = "#000033"
document.body.style.backgroundColor = "#69f"
document.body.style.margin = "0px"

// 2) Add the .page-wrapper class

let div = document.querySelector('div')
div.classList.add('page-wrapper')

// 3) Add the .summary class

let div2 = document.querySelector('#zen-summary')
div2.classList.add('summary')

// 4) Add the .sidebar class

let side = document.querySelector('aside')
side.classList.add('sidebar')

// 5) Add these links to the "Resources" <ul>
let resources = [
Expand Down Expand Up @@ -44,6 +51,15 @@ let resources = [
},
];

let list = document.querySelector('#resourceList')
let listContent = ''

resources.forEach((item) => {
listContent += `<li><a href="${item.href}" title="${item.title}">${item.linkText}</a></li>`
})

list.innerHTML = listContent

// Hint: Loop over the resources array to build each list item.
// E.g., <li><a href="someLink" title="someTitle">someText</a></li>

Expand Down

0 comments on commit 6448cea

Please sign in to comment.