setting JTextPane to content type HTML and using string builders

Every time JTextPane.setText(…) is called a new content type is determined. Start the text with “<html>” and you’ve got HTML. A new document is created, in your case HTMLDocument. @mKorbel: the following creates every time HTML for the JTextPane. buildSomething.append(“<html>”); buildSomething1.append(“<html>”); for (int i = 0; i < 10; i++) { buildSomething.append(“<span style=\”color:red\”>” + myBirthday … Read more

Why does display: inline-block; remove an underline from a child element?

Text decorations are propagated from an element to certain descendants in certain cases. The spec describes all the cases in which this happens and doesn’t happen (as well as cases where the behavior is explicitly undefined). Here, the following portion is relevant: Note that text decorations are not propagated to floating and absolutely positioned descendants, … Read more

text-decoration not working for visited state link

There is a limitation for styling the visited links; Limits to visited link styles You will still be able to visually style visited links, but there are now limits on what styles you can use. Only the following properties can be applied to visited links: color background-color border-color (and its sub-properties) outline-color The color parts … Read more

CSS text-decoration underline color [duplicate]

(for fellow googlers, copied from duplicate question) This answer is outdated since text-decoration-color is now supported by most modern browsers. You can do this via the following CSS rule as an example: text-decoration-color:green If this rule isn’t supported by an older browser, you can use the following solution: Setting your word with a border-bottom: a:link … Read more

How do I get this CSS text-decoration override to work?

text-decoration does not behave the same as other font/text related styling like font-weight. Applying text-decoration will affect all nested elements as well. Check this out: http://www.w3.org/TR/CSS21/text.html#propdef-text-decoration Excerpt: Text decorations on inline boxes are drawn across the entire element, going across any descendant elements without paying any attention to their presence. The ‘text-decoration’ property on descendant … Read more