title: Applying style to nested pages in a master page
body: <p>Why could I be unable to apply style on a nested page which is using a master page? I am just trying to apply simple some back-color to body and some div in an individual page.</p>
  <p>My (nested)page <code>Reservations.aspx</code> has this code</p>
  <pre><code>&lt;%@ Page Title=&quot;Home Page&quot; Language=&quot;C#&quot; MasterPageFile=&quot;~/Site.master&quot; 
  AutoEventWireup=&quot;true&quot; CodeFile=&quot;Reservations.aspx.cs&quot; Inherits=&quot;Reservations&quot; %&gt;
  &lt;asp:Content runat=&quot;server&quot; ContentPlaceHolderID=&quot;HeadContent&quot;&gt;
      &lt;link href=&quot;~/Styles/input.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;
  &lt;/asp:Content&gt;
  &lt;asp:Content ID=&quot;BodyContent&quot; runat=&quot;server&quot; ContentPlaceHolderID=&quot;MainContent&quot;&gt;
  &lt;div class=&quot;mainDiv&quot;&gt;
  ........
  &lt;/div&gt;&lt;/asp:Content&gt;
  </code></pre>
  <p><code>input.cs</code> has this code</p>
  <pre><code>body { background-color:Silver; }
  .mainDiv { background-color:Blue; }
  </code></pre>
  <p><code>Site.Master</code> has this code</p>
  <pre><code>&lt;head runat=&quot;server&quot;&gt;
  &lt;asp:ContentPlaceHolder ID=&quot;HeadContent&quot; runat=&quot;server&quot;&gt;&lt;/asp:ContentPlaceHolder&gt;
  &lt;link href=&quot;~/Styles/Site.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;&lt;/head&gt;
  &lt;body&gt;.........
  </code></pre>
  <p>I can get Silver Color as background of <code>Reservations.aspx</code> only if I apply this to master page which I do not want. I have not been able to get helped from accepted answer of <a href="https://stackoverflow.com/questions/1522200/asp-net-master-pages-style-sheet-per-page">This question</a> and tutorials.</p>
  <p><strong>Edit</strong></p>
  <p>using <code>&lt;link..</code> before or after might make some difference, thanks for info but it is not doing anything in this case. I have tested it both ways after my problem was solved.</p>
  <p><strong>Guidance to <code>ResolveUrl</code> solved my problem</strong>, because I tried using <code>pickurl</code> in <code>visual-studio 2010</code> instead of typing manually and got this url <code>Styles/input.css</code> instead of <code>~/Styles/input.css</code>.</p>
  <p><strong>Update =&gt; How it was Solved</strong></p>
  <p><code>href=&quot;Styles/Site.css&quot;</code> or <code>href='&lt;%= ResolveUrl(&quot;~/Styles/Site.css&quot;)%&gt;'</code></p>