Style.Font
Properti style.font yakni bentuk shorthand untuk mendeklarasikan style.fontStyle, style.fontVariant, style.fontWeight, style.fontSize, style.lineHeight, dan style.fontFamily dalam satu deklarasi.
Sintaks:
obj.style.font = value;
Nilainya:
- sub-style.font
Properti style.fontStyle, style.fontVariant, style.fontWeight, style.fontSize, style.lineHeight, dan style.fontFamily yang dipisahkan spasi.
inherit
Contoh:
<HTML> <HEAD> <TITLE>style.font</TITLE> <SCRIPT TYPE="text/javascript"> function changeFont() { document.getElementById("myp").style.font = "normal small-caps bold 54pt/68px Courier, serif"; } </SCRIPT> </HEAD> <BODY> <P ID="myp">Lorem ipsum…Lorem ipsum…Lorem ipsum…Lorem ipsum…Lorem ipsum… Lorem ipsum…Lorem ipsum…Lorem ipsum…Lorem ipsum…Lorem ipsum… Lorem ipsum…Lorem ipsum…Lorem ipsum…Lorem ipsum…Lorem ipsum… Lorem ipsum…Lorem ipsum…Lorem ipsum…Lorem ipsum…Lorem ipsum… Lorem ipsum…Lorem ipsum…Lorem ipsum…Lorem ipsum…Lorem ipsum…</P> <BUTTON TYPE="button" ONCLICK="changeFont()">Change Font!</BUTTON> </BODY> </HTML>
Demikian yang dapat kami share kepada sobat source code aplikasi pada kesempatan ini, semoga dapat bermanfaat dan bisa menjadi referensi pemrograman bagi anda. Jangan lupa like
Fan Page kami, dan
SUBSCRIBE Channel Youtube kami untuk dapatkan update source code aplikasi terbaru.