HTML DOM fontFamily ÊôÐÔ

HTML DOM Style ¶ÔÏó

¶¨ÒåºÍÓ÷¨

fontFamily ÊôÐÔ¶¨ÒåÓÃÓÚÔªËØÎı¾ÏÔʾµÄ×ÖÌåϵÁС£

Óï·¨£º

Object.style.fontFamily=font1,font2,....

¿ÉÄܵÄÖµ

Value Description
font1, font2,.... ×ÖÌå×åÃû³Æ»òÀà×éÃû³ÆµÄÁÐ±í£¬ÓɶººÅ·Ö¸î¡£

ÌáʾºÍ×¢ÊÍ

Ìáʾ£ºÊ¹ÓöººÅ·Ö¸îÿ¸öÖµ£¬²¢Ê¼ÖÕÌṩһ¸öÀà×åÃû³Æ×÷Ϊ×îºóµÄÑ¡Ôñ¡£

×¢ÊÍ£ºÈç¹û×ÖÌå×åÃû³ÆÖк¬Óпոñ£¬ÇëΪÆä¼ÓÉÏÒýºÅ¡£

ʵÀý

±¾Àý¸Ä±äÎı¾µÄ×ÖÌåϵÁУº

<html>
<head>
<script type="text/javascript">
function setFont()
{
document.getElementById("p1").style.fontFamily="arial,sans-serif";
}
</script>
</head>
<body>

<p id="p1">This is an example paragraph.</p>

<input type="button" onclick="setFont()" value="Change font" />

</body>
</html>

HTML DOM Style ¶ÔÏó

VUE