Ways to conceal the image once the fixed navigation bar appears

I've been working on a website at

After scrolling down the site, a fixed navigation bar appears. However, on this fixed navigation bar, I'd like to hide the logo navigation while still keeping it visible on the regular top navigation bar.

https://i.sstatic.net/Hdtn5.png

This is the CSS code I'm currently using:

.nav>li>a>img {
    max-width: none;
}
.menu-item a img {
    border: none;
    box-shadow: none;
    vertical-align: middle;
    width: auto;
    display: inline;
}

I want the logo to be hidden on the black fixed nav but still displayed on the regular nav. Any suggestions on how to achieve this?

You can use Chrome's inspector tool to explore this issue further.

Answer №1

To conceal the image in its fixed/black state, you can target the nav menu with the class .affix as the parent selector. This will allow you to hide the image without altering the default appearance of the menu.

.main-menu.affix .menu-image {
  display: none;
}

Answer №2

Unfortunately, I am unable to use Chrome on my iPad, which is why the navy bar appears differently at the top compared to when it's further down the page. It seems like you may be applying a different class to the nav div at some point.

You have the option to hide the image within that specific class using the style display: none;

I hope this explanation is helpful. If not, someone using a computer may be able to provide a better example.

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

How do I retrieve the value of a class that is repeated multiple times?

In the HTML code I am working with, there are values structured like this: <div class="item" onClick="getcoordinates()"> <div class="coordinate"> 0.1, 0.3 </div> </div> <div class="item" onClick="getcoordinates() ...

Remove the scrollbar from the iframe and instead display a scrollbar on the page in its place

Currently, I am facing an issue with the vertical scrollbar on an iframe. I want to remove it so that the scrollbar appears on the main page instead. This way, I will be able to scroll the content of the iframe using the page's scrollbar. I managed to ...

Uploading an image using ajax with multer

When using Multer to upload an image file to my Node server, I keep getting 'undefined' when trying to use ajax to send the image. Ajax : image = $("#input-file-img").val() const data = new FormData(); data.appe ...

Guide on customizing the checkbox label class upon @change event in Vue?

Query: I have a list of checkboxes connected to an array of names. The objective is to alter the class of a specific name when its checkbox is clicked. Issue: Clicking on a checkbox causes all names to change class, instead of only affecting the one ass ...

Can @keyframes percentage be determined using a CSS variable?

My animation is responsive to the number of characters present It functions properly with 20 characters: const text = '20 characters length' const speed = 0.1 const $container = document.querySelector('.wave') $container.style.setPr ...

Progress Bars Styled with CSS Percentages

I need help creating a basic CSS percentage bar. To get started, visit and paste the following code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://w ...

Obtain all text within a <div> element by utilizing the agility html package

When attempting to retrieve all <p> tags from within a <div> using the Agility HTML package, I encountered an issue where only the first <p> tag was obtained. <div id='bodayDiv'> <p> hi </p> <p> what is ...

Triangle-shaped border image with a gradient pattern

How can I create an odd-shaped triangle using CSS? Initially, I used transparent borders with transform: rotate to achieve the left triangle shape successfully. However, I am now attempting to use a gradient border image pattern as the background for the s ...

When using Flexbox with a column wrap and setting the height to min-content, the wrapping behavior may not

I'm facing a CSS challenge. I have divs of varying heights and I want the parent element to adjust its height based on the tallest child element, while keeping the rest of the elements aligned properly. The code provided below achieves this for rows b ...

I am in need of setting up two rows side by side using the display

I'm trying to have two rows side by side using display grid, but I'm facing some issues. When I use the following CSS... .grid-container { display: grid; grid-template-rows: auto auto; grid-template-columns: auto; grid-column-gap: 100px;} It cre ...

Determine Checkout Total with Laravel 5.2 Based on Radio Button Selections

Currently, I am developing an e-commerce platform using Laravel 5.2. At the moment, I am able to add products to my shopping cart, which is stored in a session. Once I am ready to proceed, I can view my shopping cart and upon confirmation, I am directed t ...

Is the form being submitted with the href attribute?

Does this code ensure security? <form id="form-id"> <input type='text' name='name'> <input type='submit' value='Go' name='Go'/></form> <a href="#" onclick="docume ...

Stripping initial tags from an xml string using PHP

My URL is: http://lx2.loc.gov:210/lcdb?operation=searchRetrieve&recordSchema=marcxml&version=1.1&maximumRecords=10&query=bath.isbn%3D9781594634123%0A++++ This URL returns an xml string, and I am looking to remove the opening tags of this ...

What is the reason behind opting for ng-style over style in AngularJS for applying CSS formatting?

Recently, I've delved into AngularJS and have been exploring its depths for a few days now. I'm curious about the use of ng-style in styling components within both static and dynamic webpages. Given that we already have the traditional style tag ...

Challenges with Internet Explorer 8 regarding a customized appearance for drop-down

I am facing an issue with my custom styled drop downs that are being controlled by jQuery. The problem is that in IE8, the drop down always defaults to open and does not close when an item is selected. URL removed <section class="main"> ...

What is the best way to showcase a single <ul> list in an infinite number of columns?

Utilizing Django on the backend, I aim to showcase the list below in an unlimited number of columns with overflow-x: auto. <ul class="list"> {% for i in skills %} <li>{{i}}</li> {% endfor %} </ul> Example Result: 1 7 ...

The Date validation script in Javascript is malfunctioning

I encountered an issue where the script I used in my HTML file didn't work as expected. The purpose of this script was to prevent users from submitting a date greater than today's date. Interestingly, when I copied the same script to another HTML ...

What is the best way to send an HTML report through email with embedded images as an attachment?

Currently, I am in the process of generating a report using ExtentReports that will be distributed via email to team members who are outside of our domain. To capture screenshots of any test failures, I utilize a screenshot method which saves these images ...

Listening for events on a canvas positioned beneath another element

I am currently dealing with an issue where I have a mouse move event listener set up on my canvas element. However, there is a div placed on top of the canvas with a higher z-index, which contains some menu buttons. The problem arises when I want the mous ...

Unexpected issue with sliding menu toggle implementation

I have been struggling to make a menu slide to the left when a button is clicked, and then slide back to its original position when the same button is clicked again. Although I have been using the toggle method, it doesn't seem to be working for me. I ...