Tell us what’s happening:
Guys, I’m about to bang my head to the wall by now. This header is absolutely beyond me.
This is my third week coding from scratch, mind you, and I’m changing all my projects so the look a little better and I can’t figure a way to make the H2 align left a couple of pixels away from the IMG.
Last I tried was doing a Div and sticking IMG and Header into a flex using a class selector. The logo sticks on top, doesn’t respect the 100px size at first attempt. When I shimmy displays flex or inline block, or inline anything and aligns and god knows what else they finally stick side by side but the text aligns up top and I cant separate them with either margin or padding, sometimes the logo just disappears to the left.
I am absolutely at my wits ends, so sorry if a bunch of this text doesn’t come across very organized. I need help, I won’t rest easy this weekend if I can’t figure a way to solve this.
Thanks in advance for your patience, and good weekend y’all
Your code so far
<header class="sticky-header">
<img class="logo" src="https://shorturl.at/dmq12" alt=""></br>
<h2 class="company-name"> Adopt a Cat Resource</h2>
<nav class="nav-link">
<a href="#lifestyle" class="segment">Life Style Improvement</a>
<a href="#care" class="segment">Ease of Care</a>
<a href="#mental-health" class="segment">Mental Health Benefits</a>
</nav>
</header>
* {
margin:0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: Arial, sans-serif;
width: 100vw;
background-image: url(https://shorturl.at/AFLQ0);
background-size: cover;
background-position: center bottom;
background-attachment:fixed;
background-color: rgba(255, 255, 255, 0.9);
background-blend-mode: overlay;
}
.page-body {
position: relative;
text-align: center;
}
header {
position: sticky;
top: 0;
height: 100px;
width: 100vw;
display: flex;
justify-content: space-between;
align-items:end;
background-color: rgb(34, 34, 59);
color: white;
margin-bottom: 50px;
}
.logo {
margin: 0;
height: 100px;
}
h2 {
font-size: 2.5rem;
justify-content: space-around;
}
.nav-link {
display: inline-block;
font-size: 1.25rem;
color: rgb(242, 233, 228);
margin-right: 30px;
}
.nav-link a {
padding: 0 10px;
}
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36
Challenge Information:
Product Landing Page - Build a Product Landing Page