Skip to content

Commit 53b274d

Browse files
committed
Solution for recipe-book overflow problem
1 parent 5d738fe commit 53b274d

File tree

3 files changed

+18
-10
lines changed

3 files changed

+18
-10
lines changed

scripts/recipe-book.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ async function showRecipes() {
131131

132132
// Create recipe name (h1)
133133
const recipeName = document.createElement("h1");
134-
recipeName.classList.add("recipe-dame");
134+
recipeName.classList.add("recipe-name");
135135
descriptionContainer.appendChild(recipeName);
136136

137137
// Create horizontal line (hr)

styles/recipe-book.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ a{
9898
font-family: 'Stint Ultra Expanded', cursive;
9999
font-size: 1.5em;
100100
text-align: center;
101+
max-width:30vw;
102+
word-wrap: break-word;
101103
}
102104

103105
.book {
@@ -148,6 +150,8 @@ a{
148150
padding: 10% 10%;
149151
padding-top:5%;
150152
z-index:1;
153+
word-wrap: break-word;
154+
overflow-y: scroll;
151155
}
152156

153157
.description h1{
@@ -157,6 +161,12 @@ a{
157161
line-height: 1.25em;
158162
}
159163

164+
/* .recipe-title{
165+
max-width: 10vw;
166+
word-wrap: break-word;
167+
color:#010790
168+
} */
169+
160170
.book:hover{
161171
cursor: pointer;
162172
}

templates/recipe-book.html

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,13 @@ <h1 id="my-recipe-book-title">Loading...</h1>
2828
<div class="grid-container">
2929

3030
<div class="recipe-item">
31-
<div class="book">
32-
<div class="gloss"></div>
33-
<img class="cover" src="../Images/background.png">
34-
<div class="description">
35-
<h1 class="recipe-dame"></h1>
36-
<hr>
37-
<p class="recipe-description"></p>
38-
</div>
39-
31+
<div class="book">
32+
<div class="gloss"></div>
33+
<img class="cover" src="../Images/background.png">
34+
<div class="description">
35+
<h1 class="recipe-name"></h1>
36+
<hr>
37+
<p class="recipe-description"></p>
4038
</div>
4139

4240
<h1 class="recipe-title"></h1>

0 commit comments

Comments
 (0)