Currently, I am facing an issue with keeping my logo/header at the top of the page. I have experimented with CSS properties like
position: fixed; z-index: 9999; top: 0; left: 0;
, and even tried adjusting the positioning to left: 40%;
in an attempt to center the logo on the page.
However, the result I achieved is quite basic:
<div style="text-align:center;">
<a href="/"><img src="/img/logo.png" style="max-height:100px;"/></a><br/>
</div>
Subsequently, I include this code on another page where I want the logo to appear:
<?php include 'header.php'; ?>
I attempted modifying the code segment from:
<div style="text-align:center;">
To:
<div style="text-align:center; position: fixed; z-index: 9999; top: 0; left: 40%;">
However, the issue that arises is that the header overlaps the top section of the page, causing the initial pixels to be hidden underneath the header. What I actually need is for the header to initially sit atop the page (allowing the rest of the content to flow beneath it) and only become fixed when scrolling.
How can I achieve this effect? I hope my explanation makes sense. PS: I also utilize Bootstrap, in case that information helps in finding a solution.