Skip to content

Commit de12905

Browse files
committed
added hero image and corrected image styling
1 parent a7d0797 commit de12905

File tree

2 files changed

+32
-30
lines changed

2 files changed

+32
-30
lines changed

code/index.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,13 @@
1414
</head>
1515
<body>
1616
<header>
17-
<h1>GitHub Tracker</h1>
18-
<div id="user-info"></div>
17+
<div class="hero-image">
18+
<div class="hero-text">
19+
<h1>GitHub Tracker</h1>
20+
</div>
21+
</div>
22+
<div id="user-info">
23+
</div>
1924
</header>
2025
<hr />
2126
<h2>Projects</h2>

code/style.css

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,35 @@ body {
1212
margin: 0;
1313
}
1414

15-
header {
16-
display: flex;
17-
flex-direction: column;
18-
align-content: center;
19-
width: 100%;
20-
height: 450px;
21-
background-image: url(./Images/GitHub-headpic.jpeg);
22-
background-color: rgba(0, 0, 0, 0.342);
15+
.hero-image {
16+
background: linear-gradient(rgba(0, 0, 0, 0.342), rgba(0, 0, 0, 0.774)), url("./Images/GitHub-headpic.jpeg");
17+
height: 50vh;
18+
background-position: center;
2319
background-repeat: no-repeat;
2420
background-size: cover;
21+
position: relative;
22+
border: transparent;
23+
z-index: -1;
24+
}
25+
.hero-text {
26+
text-align: center;
27+
position: absolute;
28+
top: 20%;
29+
left: 50%;
30+
transform: translate(-50%, -50%);
31+
color: var(--primary);
32+
font-size: 16px;
2533
}
2634

27-
h1 {
28-
text-align: center;
29-
color: var(--primary);
30-
font-size: 40px;
35+
.avatar {
36+
width: 40%;
37+
max-width: 350px;
38+
border-radius: 50%;
39+
margin-top: -20vh;
40+
border: var(--secondary) solid 1px;
3141
}
3242

3343
h2 {
34-
margin-top: 3em;
3544
text-align: center;
3645
color: var(--secondary);
3746
font-size: 35px;
@@ -44,7 +53,6 @@ p {
4453

4554
hr {
4655
background-color: #459ec6;
47-
margin-top: 10%;
4856
width: 70%;
4957
height: 6px;
5058
border: transparent;
@@ -68,14 +76,6 @@ hr {
6876
font-size: 20px;
6977
}
7078

71-
.avatar {
72-
width: 55%;
73-
max-width: 350px;
74-
border-radius: 50%;
75-
margin: 1em;
76-
border: var(--secondary) solid 1px;
77-
}
78-
7979
main {
8080
margin: 5em 2em;
8181
display: grid;
@@ -223,17 +223,14 @@ footer > * {
223223
grid-template-columns: repeat(2, 1fr);
224224
}
225225

226-
.avatar {
227-
max-width: 40%;
226+
.hero-text {
227+
font-size: 20px;
228228
}
229+
229230
}
230231

231232
@media (min-width: 1024px) {
232233
main {
233234
grid-template-columns: repeat(3, 1fr);
234235
}
235-
236-
.avatar {
237-
max-width: 350px;
238-
}
239236
}

0 commit comments

Comments
 (0)