Is the fixed header see-through?

I have a query regarding my website design. Currently, the fixed header on my site is transparent and when I scroll down, the content overlaps the header. However, I want the header to remain above the content. Can anyone provide assistance with this issue?

The red box represents the header while the green box symbolizes the content. As you can see, the text and images are overlapping the header:

Here is a snippet of my Header.php file:

* {
  margin: 0;
  padding: 0;
}

#header {
  background-color: #F9F6F3;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100px;
}
<div id="header">
  <header id="fh5co-header" role="banner">
    Here goes the header text and logo.

  </header>
</div>

Answer №1

In my experience, I have not encountered this error - the content consistently appears behind the header in your provided example.

To prevent this issue, you can utilize "z-index", a CSS attribute that determines the stacking order of elements on a webpage.

In the scenario below, I assigned a z-index of 10 to your header, ensuring it remains in front of any elements lacking a z-index, such as the content.

<!DOCTYPE html>
<!--[if gt IE 8]><!-->
<html class="no-js">
<!--<![endif]-->

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>TitleT</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="description" content="" />
  <meta name="keywords" content="" />
  <meta name="author" content="" />

  <!-- Facebook and Twitter integration -->
  <meta property="og:title" content="" />
  <meta property="og:image" content="" />
  <meta property="og:url" content="" />
  <meta property="og:site_name" content="" />
  <meta property="og:description" content="" />
  <meta name="twitter:title" content="" />
  <meta name="twitter:image" content="" />
  <meta name="twitter:url" content="" />
  <meta name="twitter:card" content="" />

  <!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
  <!-- <link rel="shortcut icon" href="favicon.ico"> -->

  <link rel="stylesheet" href="css/animate.css">
  <link rel="stylesheet" href="css/bootstrap.css">
  <link rel="stylesheet" href="css/icomoon.css">


  <link rel="stylesheet" href="css/owl.carousel.min.css">
  <link rel="stylesheet" href="css/owl.theme.default.min.css">

  <link rel="stylesheet" href="css/style.css">
  <script src="js/modernizr-2.6.2.min.js"></script>

</head>

<body class="boxed">
  <div id="wrap">
    <div id="fh5co-page">


      <style>
        * {
          margin: 0;
          padding: 0;
        }

        #header {
          background-color: #F9F6F3;
          position: fixed;
          top: 0;
          left: 0;
          width: 100%;
          height: 100px;
          z-index: 10;
        }
      </style>
      <div id="header">
        <header id="fh5co-header" role="banner">
          <div class="container">
            <a href="#" class="js-fh5co-nav-toggle fh5co-nav-toggle dark"><i></i></a>
            <div id="fh5co-logo">
              <a href="/"><img src="images/logo.png" height="50" width="95" alt=""></a>
            </div>
            <nav id="fh5co-main-nav" role="navigation">
              <ul>
                <li><a href="about">sdf</a></li>
                <li class="has-sub">
                  <div class="drop-down-menu">
                    <a href="services.html">dfgdfg</a>
                    <div class="dropdown-menu-wrap">
                      <ul>
                      </ul>
                    </div>
                  </div>
                </li>
                <li><a href="portfolio.html">asd</a></li>
                <li class="has-sub">
                  <div class="drop-down-menu">
                    <a href="#">gzu</a>
                    <div class="dropdown-menu-wrap">
                      <ul>
                        <li><a href="quotation">Ser</a></li>

                      </ul>
                    </div>
                  </div>
                </li>
                <li class="cta"><a href="contact">Contact</a></li>
              </ul>
            </nav>
          </div>
        </header>
      </div>
      <br>
      <br>
      <div id="fh5co-intro" class="fh5co-section">
        <div class="container">
          <div class="row row-bottom-padded-sm">
            <div class="col-md-8 col-md-offset-2 text-center ts-intro">
              <h1>About Us</h1>
            </div>
          </div>
          <div class="row row-bottom-padded-sm">
            <div class="col-md-8" id="fh5co-content">
              <h2>History</h2>
              <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Temporibus possimus, quaerat tenetur quos ad nostrum eaque esse, ex blanditiis deleniti accusantium molestias perferendis odio, iste cum. Hic eius, ullam repellendus. Possimus, ratione?
                Qui, tempora, eveniet! Eveniet facilis nesciunt commodi nostrum!</p>
              <p>Illum provident, rerum hic porro doloremque alias voluptatibus fugit aliquam aspernatur molestiae debitis fuga, expedita vel animi eius, ab natus in enim repellendus harum! Est atque quae aut? Sint quis expedita illo placeat ad saepe hic
                quidem dolore laboriosam? Sapiente.</p>
              <p>Similique sint consequuntur cum ea quia placeat aliquid blanditiis atque, et earum sit sequi. Earum dignissimos omnis, hic atque ducimus quibusdam eos, exercitationem cum ea ipsum, est animi nesciunt. Consequuntur molestias ratione asperiores
                sequi nam minima dignissimos voluptas consequatur nemo.</p>
              <p>Ut sit repellat id dignissimos excepturi recusandae reprehenderit eius, voluptatem et ab quos qui sequi rem sapiente, delectus numquam officiis. Maxime aliquam unde eum quo, sit qui voluptatum odio nam. Iste vitae, sed enim facilis suscipit
                quis obcaecati quas, nobis.</p>
              <p>Cupiditate commodi velit officia quidem dolores incidunt, deserunt nam quaerat aliquam labore iure quam. Exercitationem tempora itaque error odio quasi quas illo consequatur nisi debitis, aliquam magnam voluptas, quia, impedit, architecto
                fugit suscipit officia ullam laudantium sit libero excepturi deserunt.</p>
            </div>
            <div class="col-md-4" id="fh5co-sidebar">
              <div class="fh5co-service text-left">
                <img src="images/slider_2.jpg" class="img-responsive img-bordered" alt="Free HTML5 Bootstrap Template by FreeHTML5.co">
                <h3>WDesign</h3>
                <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Pariatur ullam unde, totam harum laboriosam dolores.</p>
                <ul class="ul_style_1">

                </ul>
              </div>
            </div>
          </div>
          <div class="row row-bottom-padded-sm">
            <div class="col-md-6">
              <p><img src="images/slider_3.jpg" alt="Free HTML5 Bootstrap Template" class="img-responsive img-bordered"></p>
            </div>
            <div class="col-md-6 padded-top">
              <h3>Creative Title Here</h3>
              <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ipsum fuga rerum doloremque dolore, molestias eligendi. Nulla aliquam aut doloribus tenetur repellendus omnis dicta, unde magni.</p>
              <ul class="ul_style_1">
              </ul>
            </div>
          </div>

        </div>
      </div>

      <footer id="fh5co-footer" role="contentinfo">
        <div class="container">
          <div class="row row-bottom-padded-sm">
            <div class="col-md-4 col-sm-12">
              <div class="fh5co-footer-widget">
                <h3>About Us</h3>
              </div>
            </div>
            <div class="col-md-3 col-md-push-1 col-sm-12 col-sm-push-0">
              <div class="fh5co-footer-widget">
                <h3>Quick Links</h3>
                <ul class="fh5co-footer-link">
                </ul>
              </div>
            </div>
            <div class="col-md-3 col-md-push-2 col-sm-12 col-sm-push-0">

              <div class="fh5co-footer-widget">
                <h3>Follow us</h3>
                <ul class="fh5co-social">
                </ul>
              </div>
            </div>
          </div>

          <div class="row">
            <div class="col-md-12">
            </div>
          </div>
        </div>
      </footer>

    </div>
  </div>

  <center>
    <center><small class='block'><font size='3'>&copy; 2015-2018 by <a href='https://auszdgfuzasdfg.com'></font></small></center>
  </center>

</body>

</html>

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

Cannot get the input padding override to work in MUI autocomplete

I've been attempting to modify the padding within the MUI autocomplete component, but unfortunately, it doesn't appear to be functioning correctly const icon = <CheckBoxOutlineBlankIcon fontSize="small" />; const checkedIcon = ...

Tips for duplicating specific div elements

Is there a way to create copies of selected divs within the same panel using a Javascript report designer? I attempted to achieve this by using the following code snippet: function DesignerClone() { $(".ui-selected").each(function () { va ...

Enhancing the responsiveness of images compared to regular images by resizing and locking them in place

I'm struggling with adjusting the responsiveness of my icons around the main wheel to changes in page size. Currently, they are not staying put relative to the middle wheel when the page size increases or decreases. I also need the wheel and icons to ...

Discover the method for inserting a title attribute value into a span element

Utilizing AngularJS to retrieve and display data within a span element. I am now aiming to utilize this value as the title for another span element. The current code being used is shown below: <span style="display: inline-block; width: 160px">{{acti ...

Tracing a path with a snapping motion using my thumb

Before we begin, let's take a look at the example below. The functionality of this component should mimic that of an input type range. However, I am facing some challenges in calculating the step value and snapping the thumb onto the trail based on t ...

Having difficulty grasping the concept behind the prepend method's functionality

I encountered an issue with my code, where I successfully created a <th> element initially, but faced problems when trying to create it repeatedly. function createTH(){ var noOfRow = document.getElementById("addItemTable").rows.length; var t ...

Utilizing the Command Line/Window feature within Visual Studio Code

As a newcomer to Visual Studio Code, I'm currently using the latest Version: 1.29.1. When I used Matlab, I had access to a script window for writing code, a Command Window for testing code snippets and viewing variable values, as well as a workspace ...

Learn how to render a dynamic checkbox that is connected with AJAX and PHP for seamless functionality

I need to showcase a dynamic checkbox that can be bound using ajax and php. Here is my code: <?php include 'dbconnect.php'; $result = mysqli_query($link, "SELECT * FROM city where district_id='$dist' "); while($city_row=mysqli_fe ...

Is there a way to seamlessly transition between different Angular components without having to refresh the entire webpage?

I'm currently working on implementing a navigation bar that allows users to switch between three components without having the navbar reload. The goal is for only the new component to load when the user clicks on a different section of the navbar, kee ...

What could be causing my Jquery fade effect to not function properly?

I'm new to incorporating Jquery into my website and I'm facing an issue with getting the first row of pictures to fade in (upwards) when scrolling. Despite my efforts, they are not behaving as expected. Any guidance on how to resolve this? HTML: ...

Using Vuejs to dynamically render raw HTML links as <router-link> elements

Hey there, I'm just getting started with VueJS and I've been doing some interesting experiments. I created a backend service using Python/Flask that provides me with a string of HTML code containing many tags. My goal is to render this HTML insid ...

Ways to keep the position of an expanded collapsible table from Material UI intact

I found a collapsible table code snippet on this website: https://mui.com/material-ui/react-table/#collapsible-table However, there seems to be an issue where when I expand a row, the table "grows up" as it increases in size. This behavior is not ideal. I ...

Setting a defined width and using block display will not solve the issue of the margin:auto not working

rough sketch of my desired design I am trying to center a label on the page. The parent container is set to a width of 100% and the label itself is displayed as a block element with margin set to auto. When I set the width of the label to a smaller value, ...

Ensure that the following div remains positioned beneath the current one

After reading through this question on Stack Overflow, about creating a responsive table with both vertical and horizontal headers, I came across this particular issue, demonstrated in this codepen example: Currently, the second table appears directly bel ...

The webpage displays the element as <span class="icon">&#xe80d;</span> instead of rendering it properly

In my ReactJS project, I have created a component called Menu1item: class Menu1item extends React.Component{ render(){ return ( <div> {this.props.glyph}{this.props.value} </div> ) ...

Unable to access GDrive on Moodle with an iOS device

I have an iframe code that works in Android, but not on iOS when embedded in Moodle. Does anyone know how to fix this issue? <p><iframe src="https://drive.google.com/embeddedfolderview?id=1d-SHXhof2KnyTmMr2GowJuf4bVKFKQg3&amp;usp#list&q ...

Shimmering effect on hover for CSS animation

Is there a way to create a CSS-only animation that fades in and out until hovered when displayed in full? I can achieve both effects separately, but I'm struggling to make them work together. The hover element doesn't seem to be functioning prope ...

Engaging in payment processing

Currently facing a significant dilemma. I am utilizing Stripe as my payment gateway, which functions in a two-step process: Collect billing information to generate a token Charge the client using the generated token The issue arises because the token ca ...

Moving DOM Elements around

Objective: Looking to relocate an element within the DOM structure. Condition: Although I am familiar with using jQuery for this task, I am currently working in an environment without access to it. Therefore, I need a pure JavaScript solution. Example: ...

Centered Bootstrap 4 modal with responsive width

Struggling to create a BootStrap 4 Modal that is centered in the screen and adjusts its width based on content? You're not alone. Despite trying different approaches like the container fluid and CSS methods, achieving a variable width modal is proving ...