Maintain format of my Java code

Discussion in 'HTML & Website Design' started by satishtalim, Jun 23, 2005.

  1. #1
    When I post an article to my blog, the article has a Java program to be displayed to my reader. I have used <pre> tag, but apart from keeping the spaces intact, the font and size of the Java source program is not to my liking, for ex. it takes too much space. You can observe my latest post on my blog, to see what I mean. Is there a better way to include Java source file listing in a post? All help apprediated.
    Update: Check this post. This is kind of format I need.
     
    satishtalim, Jun 23, 2005 IP
  2. Penfold

    Penfold Peon

    Messages:
    7
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You'll need to edit the CSS that is embedded in the <head> of your site.

    Change:
    .javacode {
      font-family: Arial, Helvetica, sans-serif;
      font-size: 10px;
      font-weight: normal;
      color: #000000;
      text-decoration: none;
      line-height: 12px;
      background-color: #E5E5E5;
    } 
    Code (markup):
    to:
    .javacode {
      font-size: 110%;
      line-height: 1.8em;
      padding: 5px;
    }
    Code (markup):
    This will use the user's default font for the pre element - which is typically a monospace font like Courier New. Adjust the font-size and line-height properties if necessary.
     
    Penfold, Jun 24, 2005 IP
  3. satishtalim

    satishtalim Peon

    Messages:
    440
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks for your help.
     
    satishtalim, Jun 24, 2005 IP