utilizing a media query specifically for tablets and desktops

I'm currently experimenting with the NOT operator in media queries

here's an example of what I'm trying to achieve:

.media{
    @media screen and not (max-width: 600px){
        display: flex;
        flex-direction: row;
        align-items: stretch; 
    }
}

Unfortunately, this code isn't functioning as expected. I'm encountering an error - any suggestions or insights would be greatly appreciated.

Answer №1

Here is the recommended solution:

    @media screen :not(media) (max-width: 600px){
        display: flex;
        flex-direction: row;
        align-items: stretch; 
  }

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

When the width is set to 100vh, there is excessive white space beneath the div

I'm dealing with a unique situation where I have a horizontal scrollable div containing different elements. To achieve the horizontal scroll, I've set the width: 100vh and rotated the div. However, this is causing an unwanted white space below th ...

Changing the Color of HTML Table Borders When Hovered Over

How can I change the color of the top and bottom border of a tr when hovering over it? The issue I am facing is that the hover styles are being overridden by the tr above it. In my example below, only the bottom border is highlighting on the second and th ...

Expanding min-content CSS Grid cell based on neighboring cells

I am working with a CSS grid that consists of two columns and five rows, but the layout changes when the display is above 768px. The first four rows are set to "min-content", while the last row is set to auto. I have defined template grid areas for each ce ...

Tips for eliminating the left margin of an unordered list (ul) that is aligned using grid

I am working with a simple grid layout: #grid{ display: grid; grid-template-columns: 1fr 1fr 1fr; list-style-type: none; } To format ten list items within the grid: <body> <ul id="grid"> <li>1</li> <li ...

Is there anyone who can take a shot at creating this calendar widget using HTML/CSS? I'm struggling to code it myself

I have been assigned a task to create a calendar widget using HTML and CSS, but I'm struggling to figure out the structure with tables or divs. Here is my design for the calendar: Here is how I've attempted to design it so far: You can view the ...

Aligning items to the left and center using CSS flexbox

Is there a way to align the first element to the left and the second element to the center within a flex container? I've tried using different options like justify-content and align-items with center, but I can't seem to get the second element in ...

CakePHP: Explaining the contrast between " $this->fetch('css') and $this->Html->css('cake.generic')" when working with CakePHP

Could anyone provide a brief explanation of these two lines found in the CakePHP layout.ctp file? It appears that both lines are used for adding CSS. What is the distinction between them? How do they function? $this->Html->css('cake.generic&ap ...

Issues with CSS causing background images/colors and containers to not stretch to full width on mobile devices

For mobile viewing, please click on this link: http://goo.gl/vkhb0 The website displays correctly on all desktop browsers and various resolutions. The top slider images are centered and 1500px wide, while the container wrappers below are 960px wide and al ...

What are the best methods for maintaining the appearance of my website when resizing my browser window?

I am replicating the Twitter profile page, but I am facing an issue where the text and images get jumbled together whenever I resize my browser. This results in a messy appearance of the page. How can I ensure that the text and images stay in the same rela ...

The step-by-step guide on creating a unique transition effect with JavaScript

Currently, I am in the process of building this website from scratch for the first time. The overall layout has been designed based on the PSD file I created, and everything seems to be going well. Now, I am looking to enhance the site by incorporating som ...

The Boostrap background is failing to display as expected in CSS, and the `position: fixed` property is

I am struggling to add an extra class within the div class= "container-fluid" in order to set a background with a fixed position, but it doesn't seem to work. The only way I can add a background-image is directly in the HTML. Why is that? Another is ...

Photo Gallery with Lightbox - Issue with Images Not Swapping Correctly

I'm currently working on developing an Ecommerce Item gallery. My main goal is to have the selected image appear in a lightbox once clicked. So far, everything works as expected except for one issue - when a user selects a second thumbnail, the lightb ...

The grid system functions flawlessly on desktop computers, but unfortunately, it fails to display correctly on mobile devices. Instead of adapting to the smaller screen size, it

I'm having an issue with my grid system. It works perfectly on PC, but not on mobile. On mobile, it shows the same view as on PC. Can anyone help me figure out what is wrong in this code? <div class="row"> <div class="col-md-3 col- ...

Difficulty encountered with altering background color of table row in Firefox using CSS

I'm facing an issue with styling table rows that have alternating classes - I want to highlight the row that is being hovered on using CSS. Below is the CSS code I have implemented: .gridrowclass1 { background-color : #bbb00b } .gridrowclass1:h ...

What is the best way to align my logo and tagline with my navigation menu?

I've been tackling a drop-down navigation menu, and I've managed to get it close to what I envisioned. However, aligning the Logo (which is essentially just h1 text) and the tagline with the navigation has proven to be a challenge. Here's t ...

Textboxes are being disabled upon the webpage loading

Initially, I have a hidden login form in one div that becomes visible when the "Login" button is clicked. This login form is located on the Master Page and includes client-side HTML5 validations for email addresses and passwords. In a child page with an A ...

Begin highlighting the columns in the table with color starting from the Nth column onwards using the td

Is there a more efficient way to apply a specific background color to multiple columns in a table without using a CSS class for each column? I have a large table with many rows and columns, and I want to minimize unnecessary code. Currently, I am utilizi ...

How come the paragraph shifts downward when I use a jQuery custom plugin to add the image source?

Check out the code below: <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <html> <head> <title>Box using Plugin</title> <script> ...

Element floating over, intersecting with the main content of the page

I am facing an issue with my CSS-styled footer that floats at the bottom of the page. When I resize the browser window, the footer overlaps the contents of the page. Although the footer is quite large, it should not overlay the page content. body { pa ...

Pop-up window triggered upon loading the page automatically

I am having trouble getting a pop-up to display whenever an unregistered user tries to access a specific page. I followed an example, but I can't seem to make it work on my page. Any suggestions? Thanks! Image: My code snippet for that page (CSS is ...