Skip to content

Commit 9501a30

Browse files
committed
Fix quote generator layout and script execution
1 parent 2bd8bea commit 9501a30

2 files changed

Lines changed: 68 additions & 23 deletions

File tree

‎Sprint-3/quote-generator/index.html‎

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,21 @@
77

88
<link rel="stylesheet" href="style.css" />
99

10-
<script src="quotes.js"></script>
10+
<!-- defer ensures JS loads after the page elements are ready -->
11+
<script src="quotes.js" defer></script>
1112
</head>
1213
<body>
13-
<h1>hello there</h1>
14-
<p id="quote"></p>
15-
<p id="author"></p>
16-
<button type="button" id="new-quote">New quote</button>
14+
<!-- Outer orange container -->
15+
<div class="outer-container">
16+
<!-- Your original title -->
17+
<h1>hello there</h1>
18+
19+
<!-- Inner white card -->
20+
<div class="quote-box">
21+
<p id="quote"></p>
22+
<p id="author"></p>
23+
<button type="button" id="new-quote">New quote</button>
24+
</div>
25+
</div>
1726
</body>
1827
</html>

‎Sprint-3/quote-generator/style.css‎

Lines changed: 54 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,82 @@
1+
* {
2+
box-sizing: border-box;
3+
margin: 0;
4+
padding: 0;
5+
}
6+
17
body {
2-
background-color: white;
3-
font-family: Arial, sans-serif;
8+
background-color: #f3a83c;
9+
font-family: Georgia, "Times New Roman", Times, serif;
410
display: flex;
511
justify-content: center;
612
align-items: center;
713
min-height: 100vh;
814
}
915

10-
16+
/* Container for heading + card */
1117
.outer-container {
12-
background-color: orange;
13-
padding: 30px;
18+
width: 90%;
19+
max-width: 650px;
1420
text-align: center;
1521
}
1622

17-
18-
.quote-box {
19-
background-color: white;
20-
color: orange;
21-
padding: 40px;
22-
width: 400px;
23+
/* Heading styling */
24+
h1 {
25+
color: white;
26+
font-family: Arial, sans-serif;
2327
margin-bottom: 20px;
28+
font-size: 28px;
2429
}
2530

31+
/* The white quote card */
32+
.quote-box {
33+
background-color: #ffffff;
34+
padding: 45px;
35+
text-align: left;
36+
position: relative;
37+
}
2638

39+
/* Quote text styling with orange quote mark added automatically */
2740
#quote {
28-
font-size: 24px;
29-
font-weight: bold;
41+
color: #f3a83c;
42+
font-size: 22px;
43+
line-height: 1.4;
44+
margin-bottom: 15px;
3045
}
3146

47+
#quote::before {
48+
content: "“ ";
49+
font-size: 40px;
50+
font-weight: bold;
51+
line-height: 0;
52+
vertical-align: -8px;
53+
}
3254

55+
/* Author text styling right-aligned */
3356
#author {
57+
color: #f3a83c;
3458
font-size: 18px;
35-
font-style: italic;
59+
text-align: right;
60+
margin-bottom: 25px;
3661
}
3762

63+
#author::before {
64+
content: "- ";
65+
}
3866

67+
/* Button styled and pushed to bottom right */
3968
#new-quote {
40-
background-color: orange;
41-
color: white;
69+
display: block;
70+
margin-left: auto;
71+
background-color: #f3a83c;
72+
color: #ffffff;
4273
border: none;
43-
padding: 15px 30px;
44-
font-size: 18px;
74+
padding: 12px 22px;
75+
font-size: 15px;
76+
font-family: Arial, sans-serif;
4577
cursor: pointer;
4678
}
79+
80+
#new-quote:hover {
81+
opacity: 0.9;
82+
}

0 commit comments

Comments
 (0)