I have an HTML file that I am loading into a JTextPane which contains two DIVs I am trying to show side-by-side (using CSS float
). Whatever I try, though, does not work. The instructions
element is displayed below the title
element, always. I've tried adjusting the widths as well. Does JTextPane not support this CSS property - must I use a table? The file displays correctly in Safari.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
@font-face {
font-family: Mentone;
src: local(Mentone),
url(Mentone.otf) format("opentype"),
}
div#container { width: 95%; margin: 0px auto; }
div#title { font-family: Mentone; font-size: 108px; width: 200px; margin: 100px 15px 0 15px; float: left; }
div#instructions { font-family: Mentone; font-size: 130%; width: 300px; margin: 100px 15px 0 15px; color: #dddddd; }
</style>
<title>Welcome</title>
</head>
<body>
<div id="container">
<div id="title">my app</div>
<div id="instructions">Instructions go here.</div>
</div>
</body>
</html>