Issue with Logo section malfunctioning on Wordpress site

Hey there, my web page is currently displaying like this:

However, as I scroll down, the background image of stars starts overlapping with the logo section, causing an issue. Here's how it looks when that happens:

This is the current CSS for the site header:

.site-header {
    position: relative;
    z-index: 1000;
    /*background-attachment: fixed; */
}

.site-header .home-link {
    color: #141412;
    display: block;
    margin: 0 auto;
    max-width: 1080px;
    height: 130px;
    padding: 0 20px;
    text-decoration: none;
    width: 100%;
}

.site-header .site-title:hover {
    text-decoration: underline;
}

.site-title {
    font-size: 60px;
    font-weight: bold;
    line-height: 1;
    margin: 0;
    padding: 58px 0 20px;
}

.site-description {
    font: 300 italic 24px "Source Sans Pro", Helvetica, sans-serif;
    margin: 0;
}

Furthermore, here's the current styling for the star image:

body.page-id-72 #stars {
    background: #425169 url("../images/photos/stars.gif") top center;
    width: 100%;
    height: 8000px;
    position: fixed;
    top: 300px;
    z-index: 100;
}

I'm looking to keep the site titles' background white like in the first image. Any assistance on resolving this issue would be greatly appreciated.

Answer №1

To enhance the visual appeal of your website, consider adding this CSS code snippet. Currently, there is no background set for .site-header, causing it to adopt the background of the surrounding div when scrolling.

.site-header {
    background: white;
    z-index: 101; //Consider including this line as well, since you previously assigned a z-index of 100 to the stars
}

If you wish to maintain the default .site-header appearance on most pages but modify it specifically where the starry background is present, experiment with this selector:

.page-id-72 .site-header {
    background: white;
    z-index: 101; //Considering the z-index given to the stars was 100, it's advisable to include this line too
}

Answer №2

Consider adding the following code snippet at the bottom of your CSS file:

.site-header {
    background-color:#FFF;
}

If the above solution does not work, you can try this alternative approach:

.site-header {
    background-color:#FFF !important; // Note: Using !important is generally discouraged.
}

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

Utilize JavaScript to trigger a gentle notification window to appear on the screen

Whenever I click a link on my HTML page, I want a popup element (just a div box) to appear above the clicked link. I have been using JavaScript for this, but I am facing an issue where the popup element appears below the link instead of above it. Can you ...

Guide to showcasing an image on an HTML page using HTTP header

I have an HTML page with a basic layout that includes a single button. When this button is clicked, it needs to trigger an HTTP request to a specific URL while including an Accept header for GET requests. The response from the HTTP URL will vary depending ...

How is it possible to encounter a Javascript unexpected token ] error within an HTML code?

While working on my project, I encountered a JavaScript error in the console of Chrome. The error message stated "Unexpected token ]" and it was pointing to a specific line of raw HTML code. I am puzzled about what could be causing this issue. Unfortunatel ...

Make a diagonal border using CSS styling

Is it possible to create a slanted border like the one shown in this image (red line) using CSS/CSS3 or JavaScript? <div id="DIV_1"> <img src="/uploads/2016/01/logo.jpg" width="250px" id="IMG_2" alt='' /> <nav id="NAV_3"& ...

Using subpixel rendering in the Blink engine causes text to appear fuzzy and less crisp

Have you noticed the recent change in Chromium's rendering engine behavior regarding non-integer pixel values? This alteration has caused text to appear blurry, impacting many websites that utilize the popular transform: translate3d(-50%, -50%, 0); ce ...

iOS devices may not display the return value of jQuery's .keypress function

My HTML table is a 9x9 grid representing a Sudoku board with input elements. To validate user input and move focus to the next box, I am utilizing jQuery's .keypress method: // Validating input for numbers 1-9 (49-57), tab key (48), and Enter key (1 ...

When the menu is unfurled, the image descends gracefully

.nav-btn { display: block; background-color: #000; color: #FFF; font-size: 1.5em; /*text-align: right;*/ /*right: 2%;*/ float: right; cursor: pointer; padding-top: 20px; /*posi ...

Enhance the speed of webview on Android devices

I have been working on an application that utilizes a webview to load both HTML and JavaScript files. Unfortunately, I have noticed a significant decrease in performance when displaying the content. Despite trying various solutions such as: webVi ...

Display content exclusively within a modal specifically designed for mobile devices

I want to implement a feature where a button triggers a modal displaying content, but only on mobile devices. On desktop, the same content should be displayed in a div without the need for a button or modal. For instance: <div class="container&quo ...

Looking for assistance in creating contemporary gallery labels?

I am in the process of creating a portfolio website and I want to showcase some of my work from middle school. However, I would like to add a label to differentiate it from my current work. The gallery features various images with different dimensions dis ...

Exploring the font variables in the asset pipeline of Rails 7

Creating a habit of defining a set of root variables is crucial for maintaining consistency throughout an application. :root { --main-font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif; --kbd-font-family: Consolas, "Libe ...

Aligning Pictures in My HTML Code

I am struggling to center images in my HTML code, as they are all aligned to the left. I'm working within Infusionsoft and have attempted various methods to center them without success. Not sure if it's a limitation of the system or if I'm m ...

What is the reason for the index.html file not connecting to the local .css files and .js file?

I'm currently using node.js to send an .html file that includes the following tags: <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta name="description" content="This is my personal profile website" /> <link r ...

Customized Bootstrap Dropdown with the ability to add text dynamically

I am working on a Bootstrap dropdown menu that allows users to generate expressions by clicking on the menu items. For example, when the "Action" item is clicked, it should insert {{Action}} into the textbox. The user can then type something like "Hello" a ...

Rewriting Queries Using URL Parameters

I'm having trouble with query rewriting not functioning as intended. I want requests going to wpsite.com/foo/bar/2/ to be rewritten as wpsite.com/foo/bar/?my_id=2. functions.php // Custom URL parameters addition function add_custom_query_var( $vars ...

I am encountering issues with the ng-bootstrap drop down menu not functioning properly when used in conjunction with *ng

The dropdown menu is designed to dynamically populate a selection of languages. I attempted to use ngFor to achieve this, but only the first item in the list appears in the dropdown menu. <nav class ="navbar navbar-light bg-light fixed-top"> &l ...

Having difficulty scrolling down in a section with 100% height on iOS devices

Currently facing an issue with a website I am creating for my wedding invitation. The top section is set to have a 100% height and requires scrolling to view the rest of the content. While it functions perfectly on FireFox / Chrome on my computer, there s ...

Mastering the alignment of Material-UI Menu items

When using the menu and menu item components of material-ui to create a select dropdown menu, I encountered an unusual issue where the dropdown menu always expands to the left side of the box, as shown in the image below: https://i.stack.imgur.com/ykRrp.jp ...

Submitting a form in a JQuery dialog box

When users encounter a sign-in form, they are faced with two options: submit or cancel. If they choose to submit, they will proceed with the action. If they decide to cancel, a different outcome will occur. There seems to be a minor issue that might not b ...

Why is it that the default theme of Material UI lacks any stylization at all?

After experimenting with both Carbon Design for React (@carbon/react) and Material UI (@mui/material) in conjunction with Next.js, I encountered styling issues with the components. While they functioned correctly to some extent, there were noticeable discr ...