如何在DW中如何改变CSS中的字体大小和颜色?

html-css016

如何在DW中如何改变CSS中的字体大小和颜色?,第1张

font:粗细

大小/行高

字体

color:颜色

比如要控制td内的宋体加粗红色文字:

td{

font:bold

16px/100%

'宋体'

color:red

}

font:粗细

大小/行高

字体

color:颜色

比如要控制td内的宋体加粗红色文字:

td{

font-size:16px

line-height:100%

font-weight:bold

font-family:'宋体'

color:red

}

需要准备的材料分别有:电脑、浏览器、html编辑器。

1、首先,打开html编辑器,新建html文件,例如:index.html。

2、在index.html中的<script>标签中,输入js代码:

$('td').click(function () {

$('td').css('font-weight', 'normal')

$(this).css('font-weight', 'bold')

})

3、浏览器运行index.html页面,点击“我是A”,此时字体会变粗。

4、再点击“我是B”,此时“我是A”的字体粗度恢复正常,“我是B”的字体变粗。