CSS를 사용하여 나란히 표시하려고하는 두 DIV가 포함 된 JTextPane에로드하는 HTML 파일이 있습니다 (CSS float
사용). 내가 시도하는 것은 무엇이든간에, 작동하지 않습니다. instructions
요소는 항상 title
요소 아래에 표시됩니다. 너비도 조정 해 보았습니다. JTextPane은이 CSS 속성을 지원하지 않습니다 - 테이블을 사용해야합니까? Safari에서 파일이 올바르게 표시됩니다.JTextPane에서 부동 DIVs
<!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>