日期:2014-05-16  浏览次数:20496 次

如何设置指定大小的行距(或则调整行距)
在 <iframe   style= "width:   100%;   height:100;line-height:30px; "   marginwidth= "0 "       marginheight= "0 "   frameborder= "1 "   id= "MsgFrame "     src= "about:blank "> </iframe>
编写的在线编辑器里,如何修改编辑器里文字的行距?

------解决方案--------------------
<html>
<head>
<meta http-equiv= "Content-Type " content= "text/html; charset=gb2312 ">
<title> +&nbsp; = </title>
<script type= "text/javascript ">
function init() {
var html = ' <html> <head> \n '
+ ' <style> \n '
+ 'p { margin:2pt 2pt 2pt 2pt; }\n '//改变它改变行距
+ ' </style> \n '
+ ' </head> \n '
+ ' <body contenteditable= "true " topmargin=1 leftmargin=1> '
+ 'aaaaaa '
+ ' </body> \n '
+ ' </html> \n ';
var editdoc = document.all[ "MsgFrame "].contentWindow.document;
editdoc.open();
editdoc.write(html);
editdoc.close();
}
</script>

</head>
<body onload= "init() ">
<form>
<iframe style= "width: 100%; height:100;line-height:30px; " marginwidth= "0 " marginheight= "0 " frameborder= "1 " id= "MsgFrame " src= "about:blank "> </iframe>
</form>
</body>
</html>