The <entry> rises above the backdrop of my introduction

Having trouble with my website development... I want to insert an <article> after the <header> with a full-screen background intro, but it seems to overlap with my <div> even though it's in the header and the article is in the body. I checked out Full screen image background on header but it didn't solve my issue...

Here's my code :

css

body{
  margin:0;
}
.intro{
  height: 100%;
  width: 100%;
  /*background-size: cover;*/

}
.text-intro{
  padding-top: 10%;
  padding-left: 5%;
}
.bg{
  position:absolute;
  z-index:-1;
  width:100%;
  height:100%;

}
h1{
  font-family: 'Montserrat', sans-serif;
  font-size: 42px;
  color: white;
  margin-top: 0;
  margin-bottom: 0;
}
article h2{
  color: white;
}
header h2{
  font-family: 'Montserrat', sans-serif;
  font-size: 28px;
  font-weight: 400;
  color: white;
  opacity: 0.3;
  margin-top: 7px;
  margin-bottom: 7px;
}
.btn-intro a{
  display: block;
  font-size: 35px;
  margin-top: 45px;
  font-family: 'Montserrat', sans-serif;
  text-decoration: none;
  color: #FFEA00;
  border: solid #FFEA00 2px;
  width: 379px;
  padding: 21px;
  -o-transition: .5s;
  -moz-transition: .5s;
  -webkit-transition: .5s;

}
.btn-intro a:hover{
  display: block;
  font-size: 35px;
  margin-top: 45px;
  font-family: 'Montserrat', sans-serif;
  text-decoration: none;
  color: black;
  background-color: #FFEA00;
  border: solid #FFEA00 2px;
  width: 379px;
  padding: 21px;
  -o-transition: .5s;
  -moz-transition: .5s;
  -webkit-transition: .5s;
}
.social img{
  width: 25px;
  height: 25px;
  padding-right: 5px;
}
article{
  position: relative;
}

html

<body>
  <header>
    <div class="intro">
      <img class="bg" src="images/bg-intro.png">
      <div class="text-intro">
        <div class="social">
          <a href="https://www.facebook.com/WarexStudio"><img src="images/facebook.svg" alt="Facebook"></a>
          <a href="https://www.twitter.com/KoenigTheo"><img src="images/twitter.svg" alt="Twitter"></a>
        </div>
        <h2>Portraits of A1 group members</h2>
        <h1>Theo Koenig</h1>
        <h2>MMi Montbéliard</h2>
        <div class="btn-intro">
          <a href="">VIEW PORTRAITS</a>
        </div>
      </div>
    </div>
  </header>
  <article>
    <h2>TP Group A1</h2>
  </article>
</body>

Answer №1

Give this a shot.

    .text-intro{
      position: fixed;
      z-index: 3;
      top: 50%;
      left: 25%;
    }

Experiment with adjusting the "top" and "left" values to achieve the desired positioning instead of relying on padding like in your previous code.

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

Tinybox is not built to execute any JavaScript code within its environment

I have been utilizing Tinybox (http://www.scriptiny.com/2009/05/javascript-popup-box/) to handle my popup functionalities. However, I've noticed that when I load a page in the popup that contains a script tag, it does not function properly. Any sugg ...

JQuery import issue hindering functionality in Internet Explorer, Firefox, and Safari

I have successfully imported the same header and footer on all of my pages. I typically use Chrome, but when I attempted to open the site I am working on in Internet Explorer and Firefox, they did not display my header and footer. What could be causing th ...

The Div element containing the rollover button/picture is failing to resize properly as the window is decreased in size

Whenever I try to resize my browser window in Firefox or Chrome, the div ends up moving instead of resizing. I've searched on stackoverflow for answers but haven't found any solutions yet. Can someone please help me with this issue? Here is what ...

Maintain the visibility of the section while it is being hovered over

I have successfully created a slidedown function that utilizes data in links to execute actions on specific sections. The script works well, however, there is an issue when trying to access the content within the section. Whenever I hover over the link, th ...

Tips for resolving issues with dropdown menu placement

Here is the current state of my HTML and CSS code: <div class="header"> <div class="container-fluid"> <div class="row"> <div class="col-1"></div> <div class="col-10"></div> <div class="col-1 dropd ...

I'm having trouble getting the data to parse correctly in ajax. Can anyone explain why it's not working?

I have implemented a system where an excel file is uploaded using AJAX, and information about the success or failure of the upload is sent from the upload page to the PHP page using json_encode. However, I am facing an issue with accessing this data indivi ...

How to bring in external HTML inner content using Javascript AJAX instead of relying on Jquery

Can someone assist me with a coding issue I'm facing? Here is the HTML code snippet: <ul class="menu-list"> <li class="active"><a href="cont1.html" title="Title 1">Link 1</a></li> <li><a href="cont2.html" ti ...

Is there a way to retrieve the fields of an index in elastic search?

After receiving a JSON object from an elastic search query, I successfully extracted the data using the code snippet below: $scope.results = response.hits.hits; console.log($scope.results); var resultstofilter = []; var resultArray = []; ...

Creating a Vue.js v-for loop to dynamically display a series of DIVs in segments

Here is the code I am currently working with: <div class="container-fluid" id="networdapp" style="display:none;"> <div class="row" > <div v-for="(result,i) in results" :key="i" class="col-sm-6" > <div class=" ...

How can I submit a form using ajax and retrieve the data as an array?

Hey there, I need some help on how to submit a form and receive data in the form of an array like this: { "notes":'some notes', "validUntil": '12/12/2015', "status": 1, "menuItemName": "HR Section", "menuItemDesc": "gggg" } Here is th ...

How to create a scrolling background image using CSS

Is there a way to make the background image scroll along with the rest of the page? I tried using background-attachment: scroll; but it did not work as expected. Initially, the background image and logo are positioned correctly, but when the page is scro ...

Style line breaks using CSS

Can CSS(3) be used to visually or textually emphasize line breaks that were automatically added by browsers? For example, displaying a symbol like ↻ at the end of each wrapped line. It is crucial to identify where lines were wrapped in source code, as n ...

Persistent button positioned at the bottom of the page, remaining visible even when scrolling to the very end of the content

I am looking to add a floating button that remains in the same position relative to the content until the window is scrolled to a certain point, after which it sticks to the end of the content. In simple terms, I want the element to act as 'relative& ...

The end of the /if in the small template system fails to correctly detect the desired condition

If I write the following line on its own, he cuts it without any reason. So...: Greetings, I'm in need of assistance regarding an issue that is currently beyond my understanding. I'm facing a challenge with a small TPL-System which requires so ...

AJAX delivers results by returning HTML code

Despite attempting various solutions from multiple sources, including this one, I still can't pinpoint the exact issue in my code. Here is a snippet of my code: $(document).ready(function() { $("#botname").blur(function() { $.ajax({ ...

Choosing an option in a Dropdown using Semantic-UI-React through code

I designed a Dropdown menu in my project using Semantic-UI-React to allow users to choose colors. https://i.sstatic.net/PkCLa.png Here is the code snippet for the dropdown menu: import React, { Component } from 'react'; import { Dropdown } fro ...

Adjust the color of a linked tab with a dropdown list on WordPress navigation menu using CSS

I'm currently working on a WordPress website utilizing the Twenty-Twelve theme. One of the main menu tabs is labeled 'Sales Items'. When hovering over this tab, it displays various categories of sales items in a dropdown list. However, I am ...

Toggle the "Active" class in the Bootstrap carousel based on the images that are available

I have 5 images that can be configured using a back-end setting for enabling them (yes/no). In my slider, if any image is missing, I want to remove that slide. This is fine with me, but the issue I am facing is related to the "active" class - it must alwa ...

When using React, the page loads and triggers all onClick events simultaneously, but when clicking on a button, no action is taken

I have a strong foundation in HTML and CSS/SASS but I'm just getting started with React. Recently, I encountered an issue that has me stumped. I am trying to highlight a button on the navigation bar based on the current page the user is on. I attemp ...

Combining Jquery scripts for seamless integration

I am facing an issue while trying to execute two different jQuery scripts simultaneously - one named balancedgallery and the other museum. Individually, each script works perfectly fine. However, when running them together, the balancedgallery script seems ...