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

📄 css0305.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.<a href="css0301.htm">字体属性</a><br>
           2.<a href="css0302.htm">颜色和背景属性</a><br>
           3.<a href="css0303.htm">文本属性</a><br>
           4.“容器”属性<br>
            ※边距属性<br>
            ※<a href="css0306.htm">填充距属性</a><br>
            ※<a href="css0307.htm">边框属性</a> <br>
            ※<a href="css0308.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;</p>
      <hr color=blue size=1>
      <p class="p2" style="line-height:17pt">  <b><font color="#336633">4、“容器”属性</font></b> 
      </p>
      <p class="p2" style="line-height:17pt">   <font color="#CC3399">※边距属性</font></p>
      <p class="p2" style="line-height:17pt">  听起来是不是很有趣,什么叫“容器”属性呢?CSS的容器属性包括边距、填充距、边框和宽度、高度、浮动、清除等属性。<br>
          您想,网页中的内容肯定是都需要“装”进这个“容器”里。“容器”属性是CSS中非常重要的一种属性,我们将分类进行学习。<br>
          先来看一下边距属性的详细列表: </p>
      <p align="center"><img src="img/css059.gif" width="395" height="113" border="0" alt="容器属性"></p>
      <p class="p2" style="line-height:17pt">   和font属性一样,表中的四个属性可以用一个属性一次。边距顺序是上、右、下、左。我们还是用定义边距属性前后的两个例子来看一下吧。请看下面的这幅图:</p>
      <p align="center"><img src="img/css012.gif" width="336" height="289" border="0" alt="未定义边距前的页面"></p>
      <p class="p2" style="line-height:17pt">   我们看到上图是没有加上边距属性的效果,而下图则在&lt;head&gt;中加入了如下代码: 
      </p>
      <p class="p2" style="line-height:17pt"><font color="#006666">  body{margin:1em 
        2em 3em 4em}</font><font color="#cc33cc"><br>
          //*定义文本的上、右、下、左的边距分别为1、2、3、4em*//</font> </p>
      <p class="p2" style="line-height:17pt">   产生的效果如下图所示:</p>
      <p align="center"><img src="img/css011.gif" width="336" height="289" border="0" alt="加上边距后的页面"></p>
      <p class="p2" style="line-height:17pt">   定义了边距后的页面,无论您怎么改变窗口的大小,它都会按照您定义好的边距样式显示。 
      </p>
      <p class="p2" style="line-height:17pt">  如果在margin里有缺失的属性,则按照顺序依次排列。比如: 
      </p>
      <p class="p2" style="line-height:17pt">  <font color="#006666">body{margin:1em 
        3em}</font> 上面这段代码的含义是:body的上、右边距为1、3em。<br>
          下一节我将向您介绍填充距属性。 </p>
      <hr color=blue size=1>
      <p class="p1" align="right"><a href="css0304.htm">上一节</a> <a href="css0306.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 + -