title: Using jQuery CSS Property to Center an Image
body: <p>Here is a piece of normal code from my site for centered images:</p>
  
  <pre><code>&lt;img width="600" alt="Image" src="img-src.jpg" style="width: 600px;"
   class="center" /&gt;
  </code></pre>
  
  <p>I am using inline styles with a class of center (the css for center is <code>margin:0 auto;</code>) to center my images on a page. I cannot set a standard width for images with the center class because the images vary in widths.</p>
  
  <p>I know jQuery has a CSS property and that got me to thinking if I can use jQuery to read the image width from the image properties and automatically insert <code>width: *image-size pulled from img properties*px;</code>to any image that has a class of center thus eliminating the need for me to manually set the image width for every image. </p>
  
  <p>Please provide examples as I not fluent in JS enough to write this myself.</p>