Attempting to conceal image on smartphones and tablets

Is there a way to hide the header image on for mobile devices only?

I thought I had the right CSS code in place, as when I check the site on a virtual small screen, the image is hidden.


@media (max-width: 768px) {
   .header-image {
      display:none;
   }
}

However, the problem arises when I view the website on an actual mobile device - the image still shows up! Any ideas why this might be happening?

Answer №1

After reviewing your website, I noticed that the internal style tag includes display:block for the .header-image class. I suggest removing that and checking the results. Additionally, please remove display:none from the .header-image class as specified in this link. Please let me know if this solution resolves the issue for you.

Answer №2

Implement Media Queries

@media only screen and (max-width: 768px) {

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

Automatically clicking the YouTube play button upon loading the video

Can anyone help me with automatically clicking the YouTube play button upon page load on a mobile device? I am currently using an iframe to display the YouTube video, which is set to autoplay on desktop but shows the play button on mobile devices. <s ...

Seamless border that flows through several elements

I'm currently working on integrating line numbers into a code snippet. I've managed to get it functioning, but there's an issue with the border between the line number and the code. Instead of being continuous, there are small, unsightly gap ...

Is there a way to eliminate this scroll bar from view?

https://i.sstatic.net/Iwz8e.png Can someone assist me in hiding this automatic visibility? Your help is greatly appreciated! Source: https://github.com/noname181/htmlcss ...

"Pairing div/span elements with sprites for improved web

I've been updating my website by replacing most inline images with sprites. Here's a basic CSS code snippet for the sprite class: .sprite{ background-image:url(...); background-position:...; width: 16px; height:16px; } After learning that nest ...

Step by step guide to showcasing images dynamically in user interface

My current project involves displaying a screen with an HTML table and an image. The HTML table is fully dynamic. The Code Working Process When the user loads a page (with a URL), I render an HTML table in different parts as the page loads. I retrieve al ...

What is the best way to align the items in my navigation bar to the center?

I'm having trouble getting my navbar buttons to appear in the center of the navigation bar. No matter what I try, they only seem to align to the left or right. Can anyone help me figure out how to center them? Here's the CSS code I'm working ...

Tips for altering the placeholder color in Angular Material?

Currently, I am working with Angular 9 and Angular Material version 10.2.0. This is the code that I have: <mat-form-field> <input matInput type="text" name="" placeholder="title" id="title" [(ngModel)]=&q ...

Hide a div element upon selecting an option from a dropdown menu

On iPhone 6plus and lower, I created a dropdown menu that opens when users click on "jobs" or "contact." However, after clicking on these options, the drop-down menu remains open. How can I make it hide automatically after a list item is clicked at this sp ...

Best practices for integrating text and images within a website header using CSS and HTML

I need help figuring out the most efficient method for creating a page header that showcases an image while keeping the text visible for search engines and in case the image fails to load. According to Google, it is recommended to use a <div> for th ...

Problem encountered when trying to create a fixed position Sticky Div

I've attempted to create a sticky DIV using the code below, but it's not behaving as anticipated. The DIV sticks when I scroll down, but it overlaps with the website Header and Footer. How can I fix this issue using CSS/JS? Any assistance would b ...

Allowing scroll events to flow through from a child <div> to <canvas> in Excalidraw

In my current project, I am utilizing Excalidraw to draw a layer of <div>s on top of the <canvas>. While everything is functioning well, I have encountered an issue with scrolling through the infinite canvas. When the mouse hovers over one of t ...

Conceal elements that are overflowing slightly

I need help coming up with a purely CSS solution to hide div 3, which has extended beyond its container. Look at the picture linked below for reference. https://i.stack.imgur.com/isfvU.jpg ...

Ensure a consistent number of draggable elements in HTML/JavaScript

Below is the HTML/JS code snippet: <!DOCTYPE HTML> <html> <head> <script> function allowDrop(ev) { ev.preventDefault(); } function drag(ev) { ev.dataTransfer.setData("text", ev.targ ...

I cannot seem to alter the background color of my image through the use of external CSS

body { background-color: #f6f7d4; } h1, h3, hr { color: #68b8ab; } hr { width: 100px; border-style: dotted none none; border-color: gray; border-width: 5px; } img { background-color: black; } Although the external CSS code a ...

Is there a way to personalize the appearance of a specific page title in my navigation menu?

I'm currently working on customizing the menu of my WordPress theme to display a different color for the active page name. Although my CSS code works well for all page names except the current one: .navbar-nav li a { font-family: georgia; fo ...

How do I incorporate left, right, and top labels with Material-ui Toggle switches?

My goal is to create a unique toggle switch design with labels positioned on each side as well as on top. For example, I am working on a left/right switch. The desired output should resemble this:          Side Left [Toggle] Right Below is ...

Hey there, I have a header.css file!

My React project is experiencing issues with the CSS file. The first header in the CSS file works fine, but the second header and every other class created after it are not responsive. Only the 'header' class is properly linked to Header.css file ...

Float and tap

Can someone assist me with my code? I have 4 identical divs like this one, and when I hover over a link, all the elements receive the same code. <div class="Person-team"> <div class="profile-pic-d"> <a cl ...

How to create horizontal spacing between divs using Bootstrap 3

I am struggling to create a small horizontal space between the "Away Team" and "Baseball Field" divs in my code. I have tried adjusting padding, margins, and even adding decimal column offsets without any success. The desired spacing effect can be seen in ...

the neighboring div sliding to the left causing the div not to expand with its content

I am trying to create a website similar to this one. When I click on the arrow, the left div collapses and the right one expands. However, the content of the right div does not expand as expected! Below is my HTML code: <div class="tools-bg"> & ...