欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

javascript字體,javascript字體變大

javascript 字體變大變小

html

光明網(wǎng)站建設(shè)公司創(chuàng)新互聯(lián),光明網(wǎng)站設(shè)計(jì)制作,有大型網(wǎng)站制作公司豐富經(jīng)驗(yàn)。已為光明近1000家提供企業(yè)網(wǎng)站建設(shè)服務(wù)。企業(yè)網(wǎng)站搭建\外貿(mào)網(wǎng)站制作要多少錢,請找那個(gè)售后服務(wù)好的光明做網(wǎng)站的公司定做!

head

script type="text/javascript"

var fontSize=16;

function changeBigger(){

if(document.getElementById("abc").style.fontSize)

document.getElementById("abc").style.fontSize=(document.getElementById("abc").style.fontSize.replace("px","")*1+1)+"px";

else

document.getElementById("abc").style.fontSize=(fontSize+1)+"px";

fontSize++;

}

function changeSmaller(){

if(document.getElementById("abc").style.fontSize)

document.getElementById("abc").style.fontSize=(document.getElementById("abc").style.fontSize.replace("px","")*1-1)+"px";

else

document.getElementById("abc").style.fontSize=(fontSize-1)+"px";

fontSize--;

}

/script

/head

body

div id="abc"這里有一段內(nèi)容/div

input type="button" value="bigger"onclick="changeBigger()"

input type="button" value="smaller"onclick="changeSmaller()"

/body

/html

字體大小默認(rèn)16

javascript字體大小

#CountMsg{

height:100%;

border:1px solid red;

font-size:40px;

text-align:center;

line-height:680px;

}

你可以在樣式里面加上以上代碼

如果感覺垂直高度不行 就改line-height的值 意思是文本的行高

javascript控制字體

html

head

titleChange Font/title

script language="javascript" type="text/javascript"

function changeMe(what)

{

var fontFlag = what.id;

if (fontFlag == "KaiTi"){

document.getElementById("msg").style.fontFamily = "Times New Roman";

} else if (fontFlag == "HeiTi"){

document.getElementById("msg").style.fontFamily = "Arial, Sans";

}

}

/script

/head

body

span id="msg"Hello,Guy!Are You OK!/span

hr/

input type="radio" id="KaiTi" name="fonts" value="楷體" onclick="changeMe(this)"/楷體

input type="radio" id="HeiTi" name="fonts" value="黑體" onclick="changeMe(this)"/黑體

/body

/html

以上代碼已經(jīng)過測試,可以直接運(yùn)行,對于你要的字體,可以search下JavaScript字體編碼,例子中可能與你提出的不符。希望對你有所幫助。

怎樣設(shè)置javascript字體

用js方法來實(shí)現(xiàn),代碼為:document.getElementById("t").style.color="red"; 說明:上面的"t"可以根據(jù)自己需要修改,具體代碼參考: 登陸通行證 function chcolor(){ document.getElementById("t").style.color="red"; }

名稱欄目:javascript字體,javascript字體變大
本文網(wǎng)址:http://chinadenli.net/article19/dsshhgh.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供面包屑導(dǎo)航定制開發(fā)微信公眾號網(wǎng)站設(shè)計(jì)域名注冊全網(wǎng)營銷推廣

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

成都定制網(wǎng)站網(wǎng)頁設(shè)計(jì)