title: How to set the width of an element equal to device-width?
body: <p>I want the header of my website to take as much width as the monitor's screen. I've tried giving <code>width: 100%</code>, <code>width: vw</code> and <code>width: device-width</code>. The problem with all these is that when I resize the browser window the header takes width equal to that of <em>current viewport</em> not the <em>device-width</em>. The code is as following:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>body {
    height: 100vh;
    width: 100vw;
  }
  * {
    margin: 0;
    padding: 0;
    font-family: courier;
    color: white;
  }
  header {
    display: block;
    height: 150px;
    width: device-width;
    background-color: #666633;
    text-align: center;
  }
  header h1 {
    font-size: 2em;
    color: white;
  }
  nav {
    width: auto;
    margin: auto;
    margin-top: 20px
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;header&gt;
    &lt;h1 class="heading"&gt; Syco Scientist Records &lt;/h1&gt;
    &lt;nav&gt;
      &lt;ul&gt;
        &lt;li&gt;&lt;a href="anupamindex.html" class="active"&gt;Home&lt;/a&gt;
        &lt;/li&gt;
        &lt;li&gt;&lt;a href="ourwork.html"&gt;Our Work&lt;/a&gt;
        &lt;/li&gt;
        &lt;li&gt;&lt;a href="testimonials.html"&gt;Testimonials&lt;/a&gt;
        &lt;/li&gt;
        &lt;li&gt;&lt;a href="projects.html"&gt;Projects&lt;/a&gt;
        &lt;/li&gt;
        &lt;li&gt;&lt;a href="contact.html"&gt;Contact Us&lt;/a&gt;
        &lt;/li&gt;
      &lt;/ul&gt;
    &lt;/nav&gt;
  &lt;/header&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>As you can see when the browser window is resized there is no option to scroll. Had I given the width in pixels then the navigation bar wouldn't collapse and could be seen when scrolled to right.</p>
  
  <blockquote>
    <ul>
    <li>How do set the width of header same as monitor screen width even when the browser window is resized?</li>
    </ul>
  </blockquote>
  
  <p>Only way I think this is possible is to use <code>@media</code> media queries which set different width for header as per the monitor width. </p>
  
  <blockquote>
    <ul>
    <li>Is there any analogous of <code>device-width</code> for non-mobile platforms?</li>
    </ul>
  </blockquote>