Foundation CSS Media Query Components

  • Default Media Queries: Refers to the default breakpoints mentioned as follows:
    • Small: for any screen size.
    • Medium: any screen having 640 pixels or larger screen size.
    • Large: any screen having 1024 pixels or larger screen size.
  • Changing the Breakpoints: Refers to the custom breakpoints using user-defined values. It uses the $breakpoint variable in which the user can set custom values for different media.
  • Sass: Refers to the Sass variables used in styling. The breakpoint mixins can be used with the named variable or with values in px, rem, and em. e.g., breakpoint(medium/640px/40rem)
  • JavaScript: Foundation JavaScript has a predefined object to work with the media queries. It can be used with the help of the Foundation.MediaQuery Object.
  • Sass Reference: Foundation also includes the Sass variables like $breakpoints, $breakpoint-classes, $-zf-size, etc.
  • JavaScript Reference: Refers to the JavaScript methods used in Foundation CSS with the help of the foundation.core.js plugin to access the HTM elements.

To leverage Foundation CSS media queries, developers can either use the pre-defined breakpoints or customize them according to their requirements. By enclosing the specific CSS styles within the corresponding media query block, the styles will be applied selectively based on the device’s screen size. 

Foundation CSS Media Queries

Foundation CSS Media Queries provides a set of predefined media queries that cover a wide range of device sizes. These media queries are categorized into different breakpoints, which are defined by the screen widths at which the layout should adapt. By utilizing these breakpoints, developers can create responsive designs that adjust fluidly across various screen sizes.

Similar Reads

Foundation CSS Media Query Components:

Default Media Queries: Refers to the default breakpoints mentioned as follows: Small: for any screen size. Medium: any screen having 640 pixels or larger screen size. Large: any screen having 1024 pixels or larger screen size. Changing the Breakpoints: Refers to the custom breakpoints using user-defined values. It uses the $breakpoint variable in which the user can set custom values for different media. Sass: Refers to the Sass variables used in styling. The breakpoint mixins can be used with the named variable or with values in px, rem, and em. e.g., breakpoint(medium/640px/40rem) JavaScript: Foundation JavaScript has a predefined object to work with the media queries. It can be used with the help of the Foundation.MediaQuery Object. Sass Reference: Foundation also includes the Sass variables like $breakpoints, $breakpoint-classes, $-zf-size, etc. JavaScript Reference: Refers to the JavaScript methods used in Foundation CSS with the help of the foundation.core.js plugin to access the HTM elements....

Syntax

To apply a different background color for small screens, we can use the following Foundation CSS media query syntax:...