A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://developer.mozilla.org/en-US/docs/Web/API/Screen/pixelDepth below:

Screen: pixelDepth property - Web APIs

MDN Web Docs
  1. Web
  2. Web APIs
  3. Screen
  4. pixelDepth

Filter sidebar

In this article
  1. CSS Object Model (CSSOM)
  2. Screen
  3. Instance properties
    1. availHeight
    2. availWidth
    3. colorDepth
    4. height
    5. isExtended Experimental
    6. mozBrightness Non-standard Deprecated
    7. mozEnabled Non-standard Deprecated
    8. orientation
    9. pixelDepth
    10. width
  4. Instance methods
    1. lockOrientation() Deprecated
    2. unlockOrientation() Deprecated
  5. Events
    1. change Experimental
    2. orientationchange Non-standard Deprecated
  6. Related pages for CSSOM
    1. CSS
    2. CSSConditionRule
    3. CSSFontFeatureValuesRule
    4. CSSFontPaletteValuesRule
    5. CSSGroupingRule
    6. CSSImportRule
    7. CSSKeyframeRule
    8. CSSKeyframesRule
    9. CSSLayerBlockRule
    10. CSSLayerStatementRule
    11. CSSMediaRule
    12. CSSNamespaceRule
    13. CSSPageDescriptors
    14. CSSPageRule
    15. CSSPropertyRule
    16. CSSRule
    17. CSSRuleList
    18. CSSStartingStyleRule
    19. CSSStyleDeclaration
    20. CSSStyleRule
    21. CSSStyleSheet
    22. CSSSupportsRule
    23. CaretPosition
    24. MediaList
    25. MediaQueryList
    26. StyleSheet
    27. StyleSheetList
  7. Guides
    1. CSS Declaration
    2. CSS Declaration Block
    3. Determining the dimensions of elements
    4. Managing screen orientation
    5. Using dynamic styling information
In this article Screen: pixelDepth property

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

Returns the bit depth of the screen. Per the CSSOM, some implementations return 24 for compatibility reasons. See the browser compatibility section for those that don't.

Value

A number.

Examples

js

// if there is not adequate bit depth
// choose a simpler color
document.style.color = window.screen.pixelDepth > 8 ? "#FAEBD7" : "white";
Specifications Specification CSSOM View Module
# dom-screen-pixeldepth
Browser compatibility See also Help improve MDN Was this page helpful to you? Learn how to contribute

.

This page was last modified on Aug 8, 2025 by MDN contributors.

View this page on GitHub

•

Report a problem with this content

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4