⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 css0301.htm

📁 网页颜色渐变,可实现网页中背景色的渐变效果
💻 HTM
字号:
<html>
<head>
<title>洪恩在线 - CSS教程</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="/pub/css/home.css">
<link rel="stylesheet" href="/pc/homepage/homepage.css">

<meta name="keywords" content="电脑乐园,电脑,乐园,交互教程,交互,教程,教育">
</head>
<body bgcolor="white" text="black" topmargin="10" leftmargin="0" marginwidth="0" marginheight="10">
<!--顶部开始--> 
<script language="Javascript" src="/pub/js/head.js"></script>
<!--顶部结束--> 
<table width="760" height="20" border=0 cellspacing="0" cellpadding="0" align="center">
  <tr> 
    <td height=20 class="p1" bgcolor="#E8E8E8" align="left"><img src="/pc/img/blank.gif" width="12" height="8"><font color="#FF9966">当前位置</font>:<a href="/default.htm" class="under">洪恩在线</a> 
      -&gt; <a href="/pc/index.htm" class="under">电脑乐园</a> -&gt; CSS教程</td>
  </tr>
</table>
<table width="760" border=0 cellspacing="0" cellpadding="0" align="center">
  <tr> 
    <td height="15"></td>
  </tr>
</table>
<table width="760" cellspacing="0" border=0 cellpadding="0" align="center">
  <tr> 
    <td width="145" valign="top" bgcolor="#E8E8E8" align="left" style="color:blue" class="p1" height="123"> 
     <br>
      <table width="145" border="0" cellspacing="0" cellpadding="0" bordercolor="#F8AC0E" height="20">
        <tr bgcolor="000099" valign="middle"> 
          <td width="115" align="center" class="p2"><b><font color="#FFFFFF">CSS教程</font></b></td>
          <td height="20" bgcolor="#E8E8E8" width="13"><img src="/pc/img/title_00.gif" width="13" height="20"></td>
          <td height="20" bgcolor="#E8E8E8" width="17">&nbsp;</td>
        </tr>
      </table>
      <p class="p1" style="line-height:17pt" align="left">  <font color="#CC3399">→</font> 
        <a href="css0101.htm">CSS快速入门</a><br>
         <font color="#CC3399">→</font> <a href="css0201.htm">怎样编写CSS</a><br>
         <font color="#CC3399">→</font> CSS属性<br>
           1.字体属性<br>
           2.<a href="css0302.htm">颜色和背景属性</a><br>
           3.<a href="css0303.htm">文本属性</a><br>
           4.<a href="css0305.htm">“容器”属性</a><br>
           5.<a href="css0309.htm">分级属性</a><br>
           6.<a href="css0310.htm">鼠标属性</a><br>
         <font color="#CC3399">→</font> <a href="css0401.htm">CSS定位</a><br>
         <font color="#CC3399">→</font> <a href="css0501.htm">CSS滤镜</a>  <br>
        <br>
      </p>
      <p align="center" class=p1><a href=/pc/bin/msg.pl?file_id=k_css target="_blank"><img src="/pc/img/message.gif" width="64" height="54" alt="请您留言" border="0"><br> 谈谈您的看法</a> 
        <br>
        <script language="javascript">
speak_num="za"
</script>
        <script language="javascript" src=/pc/var/pc_k_css.js>
</script>
        <script language="javascript">
var num=0
if (!isNaN(speak_num)){
	num=speak_num;
}
else{
	num=0
}
document.writeln ("已有")
document.writeln (num)
document.writeln ("条发言")
</script>
      </p>
      <p class="p1" style="line-height:17pt" align="left">&nbsp; </p>
      </td>
    <td width=1 bgcolor=#0586D7 height="123"><img src="/pc/img/blank.gif" width="1" height="1"> 
    </td><td width=15 background="/pc/img/line.gif"><p>&nbsp;</p></td>
    <td valign="top" background="/pc/img/line.gif" width="584" height="123" class="p2"> 
      <p align="center"><b><span class="p3"><br>
        <font color="#3366CC">三、CSS属性</font></span></b></p>
      <p align="right" class="p1">&nbsp;&nbsp;&nbsp;</p>
      <hr color=blue size=1>
      <p class="p2" style="line-height:17pt">  从CSS的基本语句就可以看出,属性是CSS非常重要的部分。熟练掌握了CSS的各种属性将会是您编辑页面更加得心应手。下面我们就借助一些实例来讲解。 
      </p>
      <p class="p2" style="line-height:17pt">  <b><font color="#336633">1、 字体属性</font></b> 
      </p>
      <p class="p2" style="line-height:17pt">  这是最基本的属性,您经常都会用到。它主要包括以下这些属性: </p>
      <p align="center"><img src="img/css056.gif" width="576" height="135" border="0" alt="字体属性"></p>
      <p class="p2" style="line-height:17pt">  光看表格是不是有些难懂,不要紧,我们来看一个用表格中的属性定义的字体样式(如下图): 
      </p>
      <p align="center"><img src="img/css003.gif" width="119" height="184" border="0" alt="不同样式的字体">  </p>
      <p class="p2" style="line-height:17pt">  第一行只是采用了“font-family”属性,代码是这样的: 
        <br>
          <font color="006666">&lt;p style=“font-family:lucida console”&gt;hongen&lt;/p&gt;</font> 
        <br>
          这行代码定义了“hongen”将以“lucida console”的字体显示; <br>
          第二行font-family为默认值,而是定义了“font-style”属性为“italic”斜体,代码如下: <br>
          <font color="006666">&lt;p style=“font-style:italic”&gt;hongen&lt;/p&gt;</font> 
        <br>
          第三行font-family为默认值,font-style为“oblique”,另外还定义了“font-weight”属性为“bold”,“font-size”属性为24pt(缺省情况下为absolute 
        size绝对大小)代码如下:<br>
          <font color="006666">&lt;p style=“font-style:oblique;font-weight:bold;font-size:24pt”&gt;hongen&lt;/p&gt;</font> 
        <br>
          最后一行只是在第三行定义的基础上又增添了“font-variant”属性为“small-caps”(小体大写),代码如下: <br>
          <font color="006666">&lt;p style=“font-style:oblique;font-weight:bold;font-size:24pt;        font-variant:small-caps”&gt;hongen&lt;/p&gt;</font><font color="#FF0066"> 
        </font><br>
          值得注意的是:“font-variant”属性值“small-caps”在指定的小体大写字体不存在的时候,CSS将用大写字母代替所有的小写字母。 
        <br>
          可能您会问:定义一个字体怎么有那么长的代码呢?其实字体属性中还一个“font”属性,可以实现简便定义。我们来看下面这段代码:<br>
          <font color="006666">&lt;p style=“font:italic small-caps bold 36pt,GlitzyCurl”&gt;Leaf&lt;/p&gt;</font> 
        此代码产生的效果是这样的(如下图):</p>
      <p align="center"><img src="img/css004.gif" width="188" height="62" border="0" alt="leaf字体1"></p>
      <p class="p2" style="line-height:17pt">   这段代码定义了“leaf”的字体为GlitzyCurl,并且是斜体、小体大写、粗体、36号字。这段代码等同于: 
        <br>
          <font color="006666">&lt;p style=“font-style:italic;font-variant:small-caps;font-weight:   bold;font-size:36pt;font-family:GiltzyCurl”&gt;Leaf&lt;/p&gt;</font> 
        <br>
          怎么样,是不是精简了许多。 <br>
          但需要注意的是:如果您用&lt;font&gt;属性直接定义,一定要注意属性值的排放顺序。  它的排放规则是按照“font-style”、“font-variant”、“font-weight”、“font-size”、“font-family”的顺序,其中没有定义的以默认值显示。 
      </p>
      <p class="p2" style="line-height:17pt">   其实我们习惯上还是不用FONT属性来统一定义,因为分开来定义的代码虽然很长,但是看上去很直观,让人一看就知道定义的内容是什么。 
        <br>
          说一点遗憾之处吧,就是CSS对中文字体的支持可能不是很好。 </p>
      <hr color=blue size=1>
      <p class="p1" align="right"><a href="css0201.htm">上一节</a> <a href="css0302.htm">下一节</a>&nbsp;&nbsp;&nbsp;</p>
      <p>&nbsp;</p>
      <p align="center" class=p2><a href=/pc/bin/msg.pl?file_id=k_css target="_blank"><img src="/pc/img/message.gif" width="64" height="54" alt="请您留言" border="0"><br> 谈谈您的看法</a> 
        <script language="javascript">
speak_num="za"
</script>
        <script language="javascript" src=/pc/var/pc_k_css.js>
</script>
        <script language="javascript">
var num=0
if (!isNaN(speak_num)){
	num=speak_num;
}
else{
	num=0
}
document.writeln ("已有")
document.writeln (num)
document.writeln ("条发言")
</script>
      </p>
    <p>&nbsp;</p></td><td width=15 background="/pc/img/line.gif"><p>&nbsp;</p></td>
  </tr>
</table>
<!--底部开始--> 
<script language="Javascript" src="/pub/js/foot.js"></script>
<!--底部结束-->
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -