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

html-css011

如何在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

}

<BODY LINK=”lime”VLINK=”lime” ALINK=”lime”>超链接的设置

ALINK 指定网页中活动链接的颜色,取值为颜色值

VLINK 指定网页中访问过的链接的颜色,取值为颜色值

LINK 指定网页中所有链接的颜色,取值为颜色值

h1本来就是标题文字,为什么要加P标签呢?下面这样写是没效果的!!

<p class="text1">

    <h1>我的颜色是红色</h1>

</p>

为什么呢?如果你找一个可以检查代码的浏览器就可以明显的看到,浏览器解析成了下面这个样子!!!这就是问题所在!!

<p class="text1">

    

</p>

<h1>我的颜色是红色</h1>

<p></p>

直接用span可以用以下方式,或者把span去掉,直接加在h1上:

<!doctype html>

<html>

<head>

<meta charset="utf-8">

<style type="text/css">

h1{

font-size:14px/*定义文字大小*/

font-weight:normal/*取消文字加粗*/

line-height:25px/*定义文字高度(行间距)*/

}

.text1 span h1{

color:#E30046/*定义文字颜色*/

}

.text2 span h1{

color:#00BF27/*定义文字颜色*/

}

</style>

<title>无标题文档</title>

</head>

<body>

<div class="text1">

    <span>

        <h1>我的颜色是红色</h1>

    </span>

</div>

<div class="text2">

    <span>

        <h1>我的颜色是绿色</h1>

    </span>

</div>

<div class="text1">

    <span>

        <h1>我的颜色是红色</h1>

    </span>

</div>

</body>

</html>

直接定义h1:

<!doctype html>

<html>

<head>

<meta charset="utf-8">

<style type="text/css">

h1{

font-size:14px/*定义文字大小*/

font-weight:normal/*取消文字加粗*/

line-height:25px/*定义文字高度(行间距)*/

}

.text1{

color:#E30046/*定义文字颜色*/

}

.text2{

color:#00BF27/*定义文字颜色*/

}

</style>

<title>无标题文档</title>

</head>

<body>

        <h1 class="text1">我的颜色是红色</h1>

        <h1 class="text2">我的颜色是绿色</h1>

        <h1 class="text1">我的颜色是红色</h1>

</div>

</body>

</html>