新聞中心
css怎么加粗
CSS 加粗使用CSS屬性單詞font-weight:
站在用戶的角度思考問題,與客戶深入溝通,找到猇亭網(wǎng)站設(shè)計與猇亭網(wǎng)站推廣的解決方案,憑借多年的經(jīng)驗,讓設(shè)計與互聯(lián)網(wǎng)技術(shù)結(jié)合,創(chuàng)造個性化、用戶體驗好的作品,建站類型包括:網(wǎng)站設(shè)計、網(wǎng)站建設(shè)、企業(yè)官網(wǎng)、英文網(wǎng)站、手機端網(wǎng)站、網(wǎng)站推廣、域名與空間、網(wǎng)頁空間、企業(yè)郵箱。業(yè)務(wù)覆蓋猇亭地區(qū)。
例子:
.yangshi1{ font-weight:bold}
.yangshi2{ font-weight:600}
font-weight對象值:從100到900,最常用font-weight的值為bold
font-weight參數(shù):
normal : 正常的字體。相當(dāng)于number為400。聲明此值將取消之前任何設(shè)置
bold : 粗體。相當(dāng)于number為700。也相當(dāng)于b對象的作用
bolder : IE5+ 特粗體
lighter : IE5+ 細(xì)體
number : IE5+ 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900
css樣式表中字體加粗的屬性是什么?
CSS字體加粗的方法:
font-weight 屬性設(shè)置文本的粗細(xì)。使用 bold 關(guān)鍵字可以將文本設(shè)置為粗體。
例如:
html:
p字體加粗/p
css:
p{
font-weight:blod;
}
css中font樣式常用的使用方法:
font-style:規(guī)定字體樣式
font-weight:規(guī)定字體粗細(xì)
font-family:規(guī)定字體系列
兩種方法給字體加粗,一種就是直接用b標(biāo)簽,例如 : b粗/b
或者用css添加樣式? div style="font-weight: bold;" 加粗 /div
可以用的值有下面這些。400 等同于 normal,而 700 等同于 bold。
normal?? 默認(rèn)值
bold?? 定義粗體字符
bolder?? 定義更粗的字符
lighter?? 定義更細(xì)的字符
100
200
300
400
500
600
700
800
900
用CSS如何讓列表字體變粗?
需要準(zhǔn)備的材料分別有:電腦、瀏覽器、html編輯器。
1、首先,打開html編輯器,新建html文件,例如:index.html。
2、在index.html中的script標(biāo)簽中,輸入js代碼:
$('td').click(function () {
$('td').css('font-weight', 'normal');
$(this).css('font-weight', 'bold');
});
3、瀏覽器運行index.html頁面,點擊“我是A”,此時字體會變粗。
4、再點擊“我是B”,此時“我是A”的字體粗度恢復(fù)正常,“我是B”的字體變粗。
CSS樣式加粗怎么寫?
!DOCTYPE?html
html
head
meta?charset="utf-8"?/
titletest/title
style?type="text/css"
ul.titlemenu?{
margin:?0;
padding:?0;
}
li.titlemenu?{
list-style-type:?none;
text-align:?center;
border-bottom:?1px?#fff?solid;
}
a?{
font-weight:?bolder;
font-size:?14px;
}
a.titlemenu:link,a.titlemenu:visited,a.titlemenu:active?{
display:?block;
color:?#000;
background-color:?#fff;
text-decoration:?none;
line-height:?50px;
padding-left:?14px;
}
a.titlemenu:hover?{
color:?#fff;
text-decoration:?none;
background-color:?#3fa200;
line-height:?50px;
padding-left:?14px;
}
/style
!--?script?type="text/javascript"?src="../jquery-1.8.0.min.js"/script?--
/head
body
ul?class="titlemenu"
li?class="titlemenu"a?class="titlemenu"abc123你/a
/li
/ul
/body
/html
DIV CSS文字粗體字如何實現(xiàn) html文字粗體字體加粗如何設(shè)置
一、使用html 加粗標(biāo)簽
使用b標(biāo)簽或strong標(biāo)簽即可對文字粗體。
1、分別對應(yīng)語法如下:
b/b
strongstrong
2、應(yīng)用案例
1)、html案例完整代碼(可以拷貝測試):
!DOCTYPE?html?html?xmlns=""?head?meta?http-equiv="Content-Type"?content="text/html;?charset=utf-8"?/?title粗體實現(xiàn)?DIVCSS5案例/title?/head?body?我是正常字體br?/?b我被b粗體/bbr?/?strong我被strong粗體/strong?/body?/html
二、使用CSS樣式實現(xiàn)文字粗體顯示 ? - ??TOP
div+css布局中,使用css樣式實現(xiàn)文字字體粗體比較多的,只需要對對象設(shè)置一個粗體樣式屬性即可實現(xiàn)文本粗體,又稱為css文字粗體。
1、css粗體樣式基礎(chǔ)
1)、單詞與介紹
font-weight,值為可以為從100到900,和bold,最常用font-weight的值為bold,也是所有瀏覽器均兼容。
2)、css 粗體語法:
div{font-weight:bold}
這樣就讓所有div對象內(nèi)文字字體加粗
當(dāng)前名稱:css樣式粗體,css字體加粗
鏈接分享:http://fisionsoft.com.cn/article/phpooe.html