media-query
Media Queries are a way to target browsers by certain characteristics, features, and user preferences, then apply styles, or run other code based on those things. They are a key part of responsive web design, as they allow you to create different layouts depending on the size of the viewport, but they can also be used to detect other things about the environment your site is running on, for example whether the user is using a touchscreen rather than a mouse. Media queries are used for the following:
- conditionally apply styles with the CSS
@media
and@import
at-rules
- target specific media for the
<style>
,<link>
,<source>
, and other HTML elements with themedia=
attribute
- test and monitor media states using the
Window.matchMedia()
andEventTarget.addEventListener()
methods
A media query is composed of an optional media type and any number of media feature expressions, which may optionally be combined in various ways using logical operators.
- Media types define the broad category of device for which the media query applies. The type is optional except when using the not or only logical operators.
* **all:** Suitable for all devices.
* **print:** Intended for paged material and documents viewed on a screen in print preview mode.
* **screen:** Intended primarily for screens.
- Media features describe a specific characteristic of the user agent, output device, or environment. Media Queries Level 4 groups 18 media features into 5 categories.
* **Viewport/Page Characteristics**
* **Display Quality**
* **Color**
* **Interaction**
* **Video-prefixed:** The spec references user agents, including TVs, that render video and graphics in two separate planes that each have their own characteristics. _(upcoming Media Queries Level 5)_
- Logical operators can be used to compose a complex media query: not, and, and only. You can also combine multiple media queries into a single rule by separating them with commas.
Here are 39 public repositories matching this topic...
Easy and predictable SASS/SCSS media queries
-
Updated
Oct 10, 2017 - CSS
Responsive Landing Page made with Flexbox and Media Queries
-
Updated
Nov 23, 2017 - CSS
This is a landing for a Coffee Shop, that serve high-quality services including coffee, tea, and juice. This landing page is fully responsive on all devices.
-
Updated
Oct 26, 2022 - CSS
It'll help you write media queries the easy way, plus other interesting functions to make you more productive coding css.
-
Updated
Sep 16, 2018 - CSS
I have Created a Responsive Navigation Bar Using HTML, CSS & JavaScript.
-
Updated
Jan 9, 2023 - CSS
This is a Responsive Webpage, check it on Mobile phone.
-
Updated
May 19, 2024 - CSS
A Simple Calculator designed using HTML, CSS and JavaScript which performs basic Arithmetic Operations.
-
Updated
Aug 26, 2023 - CSS
Browser window dimensions via CSS
-
Updated
Aug 25, 2017 - CSS
Front-end Fundamentals - How To Use Media Queries For Responsive Websites Companion Code
-
Updated
Feb 3, 2017 - CSS
Responsive design navigation creation
-
Updated
Jul 27, 2016 - CSS
Ecommerce Registered & Login UI Using HTML, CSS & Media Query.
-
Updated
Jan 17, 2023 - CSS
RWD切版練習,使用flexbox排版、media query進行相關設定,如mobile menu等等,其他還整合jquery、pug、scss、gulp、font-awesome等工具的使用來完成相關練習。
-
Updated
Jul 13, 2017 - CSS
Educational website | وبسایت آموزشی
-
Updated
Feb 21, 2022 - CSS
==> Agency Website from scratch a responsive layout "Mobile First Design" built with HTML5/CSS and a bit of JS for the menu. in this project, I learned more about modern CSS features and techniques including CSS grid, flexbox, and responsive media queries .....
-
Updated
Apr 30, 2021 - CSS
-
Updated
Jan 23, 2022 - CSS
Desafio de codificação Front-End, componente de visualização de artigo.
-
Updated
Jul 6, 2022 - CSS
It's my Day-13 of #100dayscodingchallenge I created this Fully Animated & Responsive WhatGym site with HTML CSS Javascript. Clone of SidCup Golf site. Must checkout: 👇
-
Updated
Mar 29, 2024 - CSS
This is a personal portfolio website with responsive design using HTML, CSS, Media Query
-
Updated
Sep 19, 2023 - CSS
Created by Håkon Wium Lie, W3C
Released June 19, 2012
- Followers
- 6 followers
- Website
- drafts.csswg.org/mediaqueries
- Wikipedia
- Wikipedia