读取系统字体,给出样式 搞定50分

来源:百度知道 编辑:UC知道 时间:2024/06/05 05:55:27
<style>
body,span,button{font-size:9pt;font-family:'Courier New' 宋体}
input,textarea{border:1px solid #000}
select{font-size:9pt;font-family:'Courier New' 宋体;width:150;height:10;background:#db811c}
</style>
<!--上面是为美观而定义的CSS-->
<script>
var oInitColor = "db811c" file://定义调色板的默认颜色
var oBject='<OBJECT id=dlgHelper CLASSID="clsid:3050f819-98b5-11cf-bb82-00aa00bdce0b" width="0px" height="0px"></OBJECT>' file://控件代码,字体和调色板都是它方法属性的一部分
function oFonts(){
if(!document.getElementById('dlgHelper'))document.body.insertAdjacentHTML("AfterEnd",oBject) file://如果
var oOptions="<select onchange='demo.style.fontFamily=this.options[this.selectedIndex].value'& gt;<option>共找到"+dlgHelper.fonts.count+"种字体"
for (i=1;i<dlgHelper.fonts.count;i++) file://循环输出字体
oOptions+="<option

网页设计不是很懂,给你个专业网站,你可以去他们的论坛上发问题看看。

http://www.4gee.com/

<OBJECT id="dlgHelper" CLASSID="clsid:3050f819-98b5-11cf-bb82-00aa00bdce0b" width="0px" height="0px"></OBJECT>
<select id="the_font"></select>
<script>
function setFont(){
var cnt = dlgHelper.fonts.count
for (var i = 1; i < cnt; i++){
the_font.options[the_font.options.length] = new Option(dlgHelper.fonts(i),dlgHelper.fonts(i));
}
}
window.onload = setFont;
</script>