Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Week - 1
  • Loading branch information
EliaYazdi committed Aug 12, 2019
commit d5f5873ecd7a66b482733d2d1ea5b1de530196ba
8 changes: 4 additions & 4 deletions Week1/homework/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ let books = [
]

document.body.onload = printBooks;
//now I want to print all the information in the DOM
//now I want to print all the information in the DOM.

function createAndAppend(typ, parent, attributes = {}) {
const elem = document.createElement(typ);
Expand All @@ -85,8 +85,8 @@ function printBooks() {
for (const book of books) {
const li = createAndAppend('li', ul);
const h2 = createAndAppend('h2', li, { innerText: book.title });
const author = createAndAppend('h3', li, { innerText: `Author: ${book.author}` })
const language = createAndAppend('h3', li, { innerText: `Language: ${book.language}` })
const img = createAndAppend('img', li, { src: book.cover, height: 100 })
const author = createAndAppend('h4', li, { innerText: `Author: ${book.author}` })
const language = createAndAppend('h4', li, { innerText: `Language: ${book.language}` })
const img = createAndAppend('img', li, { src: book.cover, height: 350, width: 250 })
}
}
1 change: 1 addition & 0 deletions Week1/homework/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

<head>
<title>Elia Books</title>
<link rel="stylesheet" href="style.css">
</head>

<body>
Expand Down
16 changes: 15 additions & 1 deletion Week1/homework/style.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
/* add your styling here */
body {

background-color:rgba(55, 42, 42, 1) ;
margin: 12px;
padding: 12px;

}

li {
background-color: rgba(114, 49, 49, 1);
color: white;
border-style: solid;
padding: 20px;
}
h1 {
color: white;
text-align: center;
}