title: CSS - How to set margin-left dynamically with a fixed value
body: <p>I want a div's margin left value = 50% of parent div - 300px.</p>
  
  <p>So, what I have done is-</p>
  
  <pre><code>&lt;img id="layer2" style="
        display: block;
        margin-left: 50%-300px;
        width: 300px;" &gt;
  </code></pre>
  
  <p>But it is not working.</p>
  
  <p>I also have tried-</p>
  
  <pre><code>margin-left: 300px-50%;
  </code></pre>
  
  <p>It is also not working.</p>
  
  <p>Can anyone please help?</p>
  
  <p>Thanks in advance for helping.</p>