Hello!
The issue:
i’m trying to make ‘sticky’ header work, mainly because adding margins with ‘fixed’ header seem .. crude(unless there is a way to make a scalable? margin - since my header is 15vh).
And another small issue - i’ve added borders to a sticky header, but no matter what i do, i can’t get rid of empty space between borders and preview frame(fixed header doesn’t have that issue).
Code so far:
HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial scale=1.0">
<link rel="stylesheet" href="./styles.css">
<title>Portfolio</title>
</head>
<body>
<header>
<nav>
<ul>
<li></li>
<li></li>
<li></li>
</ul>
</nav>
</header>
<section id="welcome-section">
<h1>Welcome!</h1>
</section>
<section id="projects">
<a id="project-tile" href="" target="_blank"><img src="" alt="project img"><p>Project name</p></a>
</section>
<section id="contacts">
<a id="profile-link" href=""> Profile link</a>
</section>
</body>
</html>
CSS:
header {
width: 100%;
height: 15vh;
/* display: flex;
justify-content: space-between; */
position: sticky;
border: 1px solid black;
}
#projects {
display: grid;
/* grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); */
}
section {
height: 100vh;
}