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.
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.