Results 1 to 1 of 1
Thread: Formatting HTMLDocument lists
- 02-17-2011, 05:51 PM #1
Member
- Join Date
- Feb 2011
- Posts
- 10
- Rep Power
- 0
Formatting HTMLDocument lists
I am using HTMLDocument to display some simple HTML in a JTextPane. I am also using a few simple CSS rules in the HTMLEditorKit style sheet.
Changing the H1 font style, and changing the list bullet style work OK. I can't seem to change the indentation of a <ul> list though. Currently the list is displayed too far to the right (well, in my opinion). I can't seem to change it. Here is the code which sets up the style sheet:
I have tried every combination of margins and padding, things which work in a browser. The list won't move.Java Code:protected StyleSheet setupStyleSheet(HTMLEditorKit kit) { StyleSheet styleSheet = kit.getStyleSheet(); styleSheet.addRule("h1 {font-family:Arial, Helvetica, sans-serif; font-size: 1.2em; margin-top: 20px; margin-bottom: 0px;}"); styleSheet.addRule("ul {list-style-type: circle; margin-left: 3em; padding-left: 3em; text-indent: 0em;}"); return styleSheet; }
Is this a limitation of the document class, or is there a specific way you need to define the CSS to make it work?
Similar Threads
-
Help with lists
By datreta in forum New To JavaReplies: 6Last Post: 10-29-2010, 11:33 AM -
Linked Lists
By vendetta in forum New To JavaReplies: 6Last Post: 01-26-2010, 08:23 AM -
formatting..
By sireesha in forum New To JavaReplies: 16Last Post: 06-26-2009, 07:11 PM -
HTMLDocument Structure
By Gudradain in forum AWT / SwingReplies: 0Last Post: 01-05-2009, 11:05 AM -
Stacks, lists...
By little_polarbear in forum New To JavaReplies: 7Last Post: 08-02-2008, 01:59 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks