title: Java: HTML in Swing, link margin not working
body: <p>Hi there <br>
  I'm trying to format HTML content in Swing. Formattings such as color or text-decoration are working fine. But when it comes to margin of links it is not working at all.</p>
  
  <p>This is all the CSS syntax I'm using:</p>
  
  <pre><code>StyleSheet styleSheet = kit.getStyleSheet();
  styleSheet.addRule("a {font : arial; text-decoration: none; color: #0174DF; margin-left: 50px}");
  </code></pre>
  
  <p>everything, except the <code>margin-left</code> is working. I tested the syntax in a Browser and it works fine there. I also tried using <code>text-align: left</code> or <code>display: block</code> becouse I found some articles pointing out that margin of links would not work without. </p>
  
  <p>The following HTML code is used:</p>
  
  <pre><code>&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;div&gt;
  &lt;a href="http://www.zhaw.ch" style="font-size: 50.24324324324324px"&gt;akamaitechnologies.com&lt;/a&gt;
  &lt;a href="http://www.zhaw.ch" style="font-size: 17.37837837837838px"&gt;amazonaws.com&lt;/a&gt;
  &lt;a href="http://www.zhaw.ch" style="font-size: 18.243243243243242px"&gt;cotendo.net&lt;/a&gt;
  &lt;a href="http://www.zhaw.ch" style="font-size: 24.08108108108108px"&gt;facebook.com&lt;/a&gt;
  &lt;a href="http://www.zhaw.ch" style="font-size: 17.594594594594597px"&gt;google.ch&lt;/a&gt;
  &lt;a href="http://www.zhaw.ch" style="font-size: 55.0px"&gt;heise.de&lt;/a&gt;
  &lt;a href="http://www.zhaw.ch" style="font-size: 16.08108108108108px"&gt;ip-plus.net&lt;/a&gt;
  &lt;a href="http://www.zhaw.ch" style="font-size: 21.054054054054056px"&gt;ligatus.com&lt;/a&gt;
  &lt;/div&gt;&lt;/body&gt;&lt;/html&gt;
  </code></pre>
  
  <p>The HTML code is generated by a library and can't be modified.</p>
  
  <p>From my understanding of HTML/CSS it is not possible to add <code>margin</code> style information to an inline object like a link becouse margin-top or margin-bottom is not possible. margin-left oder margin-right however should not be a problem.</p>
  
  <p>thx</p>
  
  <p>edit: by the way, I'm using HTMLEditorKit.</p>