<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Amarendra Sharma</title>
    <description>The latest articles on DEV Community by Amarendra Sharma (@amarendrasharma).</description>
    <link>https://dev.to/amarendrasharma</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1031994%2Fa399ecfd-025b-40c8-b791-4b84a5c0edd7.jpeg</url>
      <title>DEV Community: Amarendra Sharma</title>
      <link>https://dev.to/amarendrasharma</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/amarendrasharma"/>
    <language>en</language>
    <item>
      <title>Media Query Screen Range With Operators - Short And Easy</title>
      <dc:creator>Amarendra Sharma</dc:creator>
      <pubDate>Wed, 22 Feb 2023 22:07:34 +0000</pubDate>
      <link>https://dev.to/amarendrasharma/media-query-screen-range-with-operator-short-and-easy-327c</link>
      <guid>https://dev.to/amarendrasharma/media-query-screen-range-with-operator-short-and-easy-327c</guid>
      <description>&lt;p&gt;In order to write a media query, we use the @media rule, followed by a media type and a set of features that describe the conditions under which the styles will be applied.&lt;/p&gt;

&lt;p&gt;The media type can be either screen or print, and the features can include things like screen width, orientation, resolution, and more.&lt;/p&gt;

&lt;p&gt;For example, if we wanted to target devices with a screen width between 420px and 720px, we can use the following media query:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="k"&gt;@media&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;min-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;420px&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;and&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;max-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;720px&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c"&gt;/* Styles for devices with a screen width between 420px and 720px */&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Alternatively, we can use comparison operators to achieve the same result&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="k"&gt;@media&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;420px&lt;/span&gt; &lt;span class="err"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;width&lt;/span&gt; &lt;span class="err"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="m"&gt;720px&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c"&gt;/* Styles for devices with a screen width between 420px and 720px */&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>css</category>
      <category>mediaquery</category>
      <category>html</category>
    </item>
  </channel>
</rss>
