What could be causing the website content to appear above the navbar while scrolling?

When scrolling, the website content is overlapping the navigation bar, and I am unsure how to resolve it. Here is the HTML code:

<body>
    <header>
        <p class="logo">גכשד יחכי</p>  
        <nav>
            <ul class="nav_links">
                <li><a href="#">אודות</a></li>
                <li><a href="#">שירותים</a></li>
                <li><a href="#">פרוייקטים</a></li>
            </ul>
        </nav>
        <a class="cta" href="https://support.microsoft.com/he-il/contactus/"><button>צור קשר</button></a>
    </header>
    <div class="intro"></div>
    <main>
        <h1 class="main-text">פסיכולוגית<br /> חינוכית</h1>
        <p class="secendery-text">חשדג גשחכי היא פסיכולוגית חינוכית<br /> העוסקת במקצוע זה למעלה מ20 שנה <br /></p>
        <img src="images/psychology1.png" alt="" class="side-image" />
    </main>
    <div class="card">
        <img src="images/img_avatar.png" alt="Avatar" >
        <div class="container">
            <h4><b>b</b></h4>
            <p> </p>
        </div>
    </div>
</body>
</html>     

The following CSS code might be related to the problem:

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

li, a, button {
    font-family: 'Rubik', sans-serif;
    font-weight: 500;
    font-size: 16px;
    text-decoration: none;
    color: #edf0f1;
}


header {
    display: flex;
    background-color: #24252A;
    justify-content: space-between;
    align-items: center;
    padding: 10px 10%;
    position: fixed;
    top: 0;
    width: 100%;
}



.nav_links {
    list-style: none;
    display: flex;
}
nav{
    order:2;
}

.cta{
    order:1;
}
.nav_links li {
    display: inline-block;
    padding: 0px 20px;
}

.nav_links li a {
    transition: all 0.3s ease 0s;
}

.nav_links li a:hover {
    color:#ddad34;
}




.main-text {
    font-family: 'Rubik', sans-serif;
    margin: 0;
    padding: 0;
    position:absolute;
    top: 32%;
    right: 25%;
    direction: rtl;
    font-size: 60px;
    color: black;
}

.secendery-text {
    font-family: 'Rubik', sans-serif;
    margin: 0;
    padding: 0;
    position: absolute;
    top: 48%;
    right: 25%;
    direction: rtl;
    color: darkgray;
}

.side-image {
    position: absolute;
    top: 20%;
    left: 5%;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translatey(0px);
    }

    50% {
        transform: translatey(-20px);
    }

    100% {
        transform: translatey(0px);
    }
}

.

If anyone knows how to fix this issue, please provide assistance. Thank you!

Answer №1

To address your issue, make sure to include a z-index property for the header element. Without specifying a z-index, elements will be layered based on their declaration order (with elements using position: absolute/fixed overflowing previous ones with the same positioning). Consider adding the following line to the css file for the header: header { z-index: 100;} Additionally, when seeking assistance in the future, try to provide a more clear and concise description of your problem.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Problem with CSS creating the Typewriter effect when the third line of text is added

I've been working on a website for my new company and I want to incorporate a typewriter effect on the main page. I came across a tutorial on Medium.com but I'm having trouble adding an additional span to the provided code. Take a look at the lin ...

The optimal method for designing a select menu to ensure it works smoothly on various web browsers

Recently, I encountered an issue with customizing a select menu using CSS and jQuery. After some work, I was able to achieve a result that I am quite pleased with: So far, the styling works perfectly in Mozilla, Opera, Chrome, and IE7+. Below is the curr ...

hide the scroll button when at the top of the page and hide it when at the bottom

Looking to create a vertical scroll that hides the up button when at the top and hides the down button when at the bottom? Jquery can help with this, but sometimes it's tricky to get it just right. Take a look at an example here. Below is the code sn ...

The datepicker within the dialog box is obstructed

There seems to be an issue that I'm encountering: https://i.sstatic.net/7aFqA.png Whenever I click on the datepicker input, the calendar appears overlapped. This is evident because when I hide the dialog, the calendar displays correctly: https://i. ...

What is the best way to retrieve the value of a component's HTML id tag in React?

Is there a way for me to retrieve the id of a react component from within the component itself? I need this information to perform some tasks with a third-party library. In Ember, you can access the component's id using elementId, which can be found ...

transform the stationary drawing to the top and left position at coordinate (0,0)

Exploring canvas has led me to encounter a puzzling issue with the translate method. While working on this fiddle http://jsfiddle.net/claireC/ZJdus/4/, my goal was to have the drawing move and bounce off all four walls. However, I noticed that it would no ...

Add HTML syntax highlighting to a text area for coding purposes

I am facing a seemingly straightforward issue, but I worry that it may be too complex for me to handle on my own. My goal is to incorporate a textarea into a webpage where users can input HTML code, click a button, and have the interpreted HTML displayed i ...

Full height Footer using Flash and HTML

Seeking advice: I successfully implemented a Flash object with 100% height and width on an HTML page. However, I am struggling to add an HTML footer that stays fixed at the bottom of the page. Attempts made: I have tried various solutions, searched on Go ...

Exploring the boundaries of HTML data manipulation using JavaScript or jQuery

In my HTML (within a Twig template), there is the following code snippet: <li id="{{folder.id}}" data-jstree='{"icon":"glyphicon glyphicon-tags", "type":"folder"}' ><a href="#">{{folder.name}}</a> I'm attempting to extrac ...

Avoiding memory leaks and performance hiccups in canvas applications

Currently, I am utilizing a canvas to present a grid made up of interconnected dots (a common feature in many codepens and experiments), and everything functions smoothly. In order to make the canvas responsive, I encapsulated all my code generation within ...

Tips on avoiding global CSS styles from a UI framework within a Vue application

For my project, I am utilizing the Element UI framework along with their tables. In order to accommodate a filter input at the top of the table body, I need to add some padding. However, not all tables in my project will have this filter input, so not all ...

Images are failing to show up in the iPhone design

Encountering issues with displaying images on an iPhone? You can replicate the problem by minimizing your browser window horizontally. Here is a link showcasing the problem: here. To temporarily fix this, try zooming out the browser (Ctrl+-). You can see a ...

Obtaining the unique identifier of a div element using AngularJS

Recently, I've assigned the id of ng-repeat as objectId, like this: <div class="mainListLabel " ng-if="profile==1" id={{obj.boeId}} ng-repeat="obj in mainList" ng-click="getEmployeeInformation(obj.boeId)">{{obj.boedisplayName}}</ ...

Attempting to locate the following div element using a particular class name, however, I consistently retrieve the final one

I have a magician and I'm attempting to design a progress bar. The current step that the user is on should be purple and should advance as the user moves through the form. However, when trying to proceed to the next step, the progress bar incorrectly ...

Display a div using ASP.NET when a button is clicked

I am currently attempting to display a loading div when a button is clicked, however, I am encountering some issues with the functionality. Javascript : <script type="text/javascript"> $(document).ready(function (e) { $(&a ...

Functionality limited to Firefox browser

I'm having some trouble with my website development in HTML5 and CSS3. Specifically, I am struggling to get my processing sketch to work on browsers other than Firefox. Below is the code I am working with: <!DOCTYPE html> <html> ...

Having trouble with the JQuery scrollTop animation? Getting the error message "Cannot read property 'top' of undefined"?

I am having trouble with my jquery animation scrollTop function. Whenever I click on <a>, it takes me to the anchor without any animation. Can someone please provide a solution for this issue? Upon running the webpage, I encountered an error message ...

Variety of app icons for Android and iOS platforms

From my understanding, there are 2 meta tags that both operating systems support, which are: <link rel="apple-touch-icon" href="#"/> <link rel="apple-touch-icon-precomposed" href="#"/> I am looking to display 2 different icons for Android and ...

Navigating on Blogger can be a tricky task when it comes to searching and

I recently added a Table to my blogger post, along with an input form for readers to easily search data. After finding the code on W3Schools (link here), I implemented it successfully. However, I am looking to make some improvements. Here is my question: ...

Adjust the vertical alignment of the Bootstrap Navbar Container

Seeking a solution to modify the default positioning of a container within the Bootstrap navbar. By default, it is vertically centered in the navbar wrapper (refer to the image below), but I would like it to be aligned to the top. https://i.sstatic.net/XU ...