hey guy ı work on landing page project it almost finis just left the media query but I have problem adding position fixed on header when I add the position fixed my header layot broken were I did wrong and how I fix this problem.
here is my page.
I try add position fixed in nav-link when didn’t add header its work but at the same time I add img same property it didt work work why.
- Keep the test script when forking the pen (
<script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
).- The test script should be there when you submit your project too.
It’s failing because you’ve given everything a class
and the tests are looking for an id
. Btw, you can have both. I changed your code a little to look like this;
<header id="header" class="header">
<img id="header-img" class="img-header" src="https://upload.wikimedia.org/wikipedia/commons/thumb/f/fa/Apple_logo_black.svg/1200px-Apple_logo_black.svg.png" alt="apple logo">
<nav id="nav-bar" class="nav-link">
And in CSS I added the position
and top
properties (I’ll leave it to you to figure out the values for the two properties) to a #header
declaration and the test passed.
Btw, <il>
it not how you declare a list item
1 Like
thanks your feedback roma.
ı add id html elements also I was don’t know id and class use with same time thanks for this info.
also I add script my project.
I solve position fixed for header.