In Mobile View, I want to swap out my current image for text to keep it hidden

I am attempting to include text that is only visible in Mobile View as a replacement for my logo. Below is the code I am using:

CSS:

@media only screen and (max-width:1024px) {
  header .logo {
    display: none;
  }
  header .logo a {
    display: none;
  }
}

@media only screen and (max-width:768px) {
  header .logo {
    display: none;
  }
  header .logo a {
    display: none;
  }
}

@media only screen and (max-width:600px) {
  header .logo {
    display: none;
  }
  header .logo a {
    display: none;
  }
}

@media only screen and (max-width:400px) {
  header .logo {
    display: none;
  }
  header .logo a {
    display: none;
  }
}

.mobileShow {
  display: none;
}


/* Smartphone Portrait and Landscape */

@media only screen and (max-device-width: 768px) and (max-device-width: 600px) and (max-device-width: 400px) {
  .mobileShow {
    display: inline-block;
    top: 40px;
    left: 0px;
    right: 0px;
  }
}
<header class="main-header">
  <div class="row">
    <div class="logo animated bounce">
      <a>Game Ware</a>
    </div>
  </div>
  <div class="mobileShow">
    <h1 style="text-align: center; font-size: 40px;">GAME WARE</h1>
  </div>
</header>

View the mobile site here: http://mobt.me/zgly

View the full site here: https://i.sstatic.net/DoAQm.jpg

The text "Game Ware" intended for mobile view is currently not showing, but it does appear in the normal view. The goal is to have it visible exclusively in Mobile View and hidden in the standard view.

Your assistance is greatly appreciated! What corrections should be made in this code?

Answer №1

Utilize the bootstrap class hidden-sm hidden-xs hidden-md hidden-lg to selectively hide elements based on screen resolution, allowing for content to be hidden on small, medium, and large screens.

<header class="main-header">
    <div class="row">
        <div class="logo animated bounce hidden-sm hidden-xs">
             <a>Game Ware</a>
          </div>
        <div class="mobileShow hidden-md hidden-lg">
             <h1 style="text-align: center; font-size: 40px;">GAME WARE</h1>
        </div>
    </div>
</header>

Answer №2

<header class="main-header">
   <div class="row">
        <div class="logo animated bounce visible-sm visible-md visible-lg">
             <a>Tech World</a>
        </div>

        <div class="mobileShow visible-xs">
        <h1 style="text-align: center; font-size: 40px;">TECH WORLD</h1>
        </div>
    </div>
</header>

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

Ensure that the child div is anchored to the bottom of the parent div container

I am looking for a way to ensure that the subfooter div stays at the bottom of the childbox div, similar to a footer. You can view the code on this jsfiddle link <div class="parentbox"> <div class="childbox"> <div id="subfooter" ...

Multiple images overlapping each other in a dynamic parallax effect

Despite my fear of receiving down votes, I have been unsuccessful in finding the answer to my question so I will proceed with asking it. I am attempting to replicate a parallax effect similar to the one showcased on this website, particularly the image of ...

Expanding Images with JQuery Accordion

I'm facing a problem where I need to include accordions on my website with images, but whenever the accordion is opened, the image ends up stretched. Is there a solution to prevent this from happening? Below is the code snippet I am using: [Fiddle] ...

Styling a PrimeFaces panelGrid within a data table using CSS

I am struggling to add a background color to a panelgrid within a datatable when a hover event occurs. Despite writing the necessary code and CSS, nothing seems to work. Any suggestions on how to address this issue? <p:dataTable id="movementsTable" var ...

Selecting specific categories to display on the homepage and limiting the number of images shown

<<html> <head> <meta charset='utf-8'> <meta http-equiv='X-UA-Compatible' content='IE=edge'> <title>Gallery</title> <!-- CSS only --> <link href="https://cdn.jsdel ...

What is the process behind the creation of the class or id fields in HTML for Gmail and Quora? How are these

When using Gmail: <tr class="zA yO" id=":1t4"> While on Quora: <span id="ld_zpQ1Cb_27965"> What is the purpose behind this and what specific tool do they employ to achieve it? ...

What methods can I use to extract particular information from HTML when working with React?

I am currently working with an API that returns a preformatted HTML file containing CSS styles and ID tags that indicate specific information I need to extract. The challenge is that the HTML code is not very visually appealing, and I want to render it usi ...

The div element continuously wraps its content when the browser size is reduced

Is there a way to prevent a div from wrapping or shifting below when resizing the browser to the left? I want this specific box to remain fixed in its position, causing the user to use the horizontal scroll bar to view it while everything else on the pag ...

How can I integrate checkboxes in a list view with jQuery Mobile?

How can I display the status of users with three different levels in a list view? I need to show whether they are attending or not, similar to the image provided. The issue is that currently the checkbox appears below the name, but I want it to be at the r ...

How to add icons to HTML select options using Angular

Looking for a way to enhance my component that displays a list of accounts with not only the account number, but also the currency represented by an icon or image of a country flag. Here is my current component setup: <select name="drpAccounts" class= ...

Unable to locate the iframe in the test scenario

I encountered this particular test case: Select Frame id=coach_frame63454108.cf1 Wait Until Element Is Visible ${ap.gui.header.appname} Page Should Contain Element ${ap.gui.header.appname} Page Should Contain Element ${ap.gui.hea ...

Can users be prevented from bookmarking a particular web page?

I'm working on a Python (Django) webpage and I need to prevent users from being able to bookmark a certain page. Is there a way to do this? ...

Customizing active-class in Vuetify

How do I customize the appearance of my v-list-item-group when it is in the active state? <v-list> <v-list-item-group v-model="day" color="green"> <v-list-item v-for="(item, i) in items" :key="i"> <v-list-item-content& ...

Why Chrome Doesn't Alter the State of li Elements

I'm unsure why, but the CSS code in this particular fiddle fails to function correctly on Chrome. On Firefox, when hovering over one of the li elements, the text becomes visible as expected, whereas this does not occur on Chrome. It seems that changin ...

Is there a way to superimpose multiple PNGs and ensure that each one is clickable within its designated area?

I am looking to implement a interactive image system for dynamically generated content. The image includes a background image and various grey-scale mask images. Background Image: https://i.sstatic.net/NWzQ1.jpg (source: goehler.dk) Masks: https://i.ss ...

Unable to activate check box button by clicking on it

Hi there! I am having trouble with a checkbox button on my website. The button appears fine, but for some reason it's not working properly (it doesn't get unchecked when clicked). Can anyone help me fix this issue? I'm still learning HTML an ...

Expanding Bootstrap 5 navbar-nav to occupy entire screen space in collapsed state

Hello everyone, I hope you are doing well! I am currently working on a website project using Bootstrap 5 and have encountered an issue with the navbar toggler. While the toggler is functioning properly, I am having trouble making it fill the full width o ...

What is the best way to implement coding for portrait styles specifically on the Kindle Fire device?

Any recommendations on how to specifically code the styles for portrait orientation solely on the Kindle Fire device? ...

Achieving Full Width Coverage for a div with 100% Width Using the Meta Viewport Tag "width=device-width"

Currently, I am working on optimizing my website to adjust for mobile browsers. In order to achieve this, I have two CSS files - one that is always included and another with media="screen and (max-width:500px)" To ensure proper functionality, I am utili ...

CSS directives are not compatible with Internet Explorer 8

I implemented a registration form with CSS rules that highlight error fields with a red border when users submit incorrect or empty data. However, this functionality is not working in Internet Explorer. The red border appears correctly in Firefox and Safar ...