Media Query
Techopedia explains Media Query
Media queries consist of a media type along with one or more expressions that conditionally check for certain media features, particularly that of screen sizes. The logical expressions in a media query can be either true or false; it is true if the media type of the query matches that of the media type of the device where the user agent (Web browser) is running on; otherwise, it is false. When the media query results to true, then the corresponding style rules specified will be applied, following normal cascading rules. It must be noted that, even if the query results to false, style sheets specified within the <link> tag are still downloaded, but are simply not applied.Example using the HTML <link> tag:
<link rel="stylesheet" media="(max-width: 600px)" href="specific.css" />
Example using @media within the <style> tag:
<style>
@media (max-width: 500px){
.left_sidebar {display: none; }
}
</style>
Survey: Why Is There Still a Gender Gap in Tech?
Do you work in the tech industry? Help us learn more about why the gender gap still exists in tech by taking this quick survey! Survey respondents will also be entered to win a $100 Amazon Gift Card!
Related Reading
- Moving from Flash to HTML5
- HTML5: For The Future Web
- INFOGRAPHIC: HTML5 - Why Developers Need It
- 5 Things You Need to Know About HTML5
- Data Breach Notification: The Legal and Regulatory Environment
- Artificial Intelligence in Cybersecurity