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

📄 ◤css教程_css定位1--▃▄ 龙 人 网 络 ▄▃.htm

📁 web开发离不开css层叠样式表。此书言简意赅介绍了css技术。最常用的、最简洁的实例。希望对各位有所帮助!
💻 HTM
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0039)http://www.rr365.net/edu-css/css105.htm -->
<HTML><HEAD><TITLE>◤CSS教程.CSS定位1--▃▄ 龙 人 网 络 ▄▃</TITLE>
<META http-equiv=Content-Language content=zh-cn>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="CSS教程,CSS技巧 " name=keywords>
<META 
content=网页制作教程:asp教程,ASP.net教程,XML教程,PHP教程,FrontpageXP教程,DreamWeaverMX教程,JSP教程,JavaScript教程,VBScript教程,CSS教程,FrontpageXP,DreamWeaverMX,JSP,JavaScript,VBScript,CSS,asp,ASP.net,XML,PHP相关技巧及资源 
name=description><LINK href="◤CSS教程_CSS定位1--▃▄ 龙 人 网 络 ▄▃.files/style.css" 
type=text/css rel=stylesheet>
<META content="MSHTML 6.00.2900.2604" name=GENERATOR></HEAD>
<BODY language=Javascript1.2 
onmouseover="window.status='欢迎光临【龙人网站】www.rr365.net,专业服务全为您!!!';return true" 
onclick=dynOutline() ;>
<TABLE id=table1 width="100%">
  <TBODY>
  <TR>
    <TD background="◤CSS教程_CSS定位1--▃▄ 龙 人 网 络 ▄▃.files/logo4.gif" colSpan=8 
    height=30> </TD></TR>
  <TR>
    <TD width=195 height=53><A href="http://www.rr365.net/index.htm"><IMG 
      height=53 alt=网站优化,网站排名 
      src="◤CSS教程_CSS定位1--▃▄ 龙 人 网 络 ▄▃.files/logo-up.gif" width=195 
      border=0></A></TD>
    <TD colSpan=7>
      <H1 align=center>网页制作教程:CSS教程</H1></TD></TR>
  <TR>
    <TD background="◤CSS教程_CSS定位1--▃▄ 龙 人 网 络 ▄▃.files/logo-bt.gif" height=31>
      <P align=center><A 
      href="http://www.rr365.net/edu-webdesign/index.htm"><FONT 
      color=#000000>网页制作教程</FONT></A></P></TD>
    <TD align=middle bgColor=#e5ecf9><B><A 
      href="http://www.rr365.net/index.htm">首&nbsp;&nbsp;&nbsp; 页</A></B></TD>
    <TD align=middle bgColor=#e5ecf9>
      <DIV><B><A 
    href="http://www.rr365.net/web-promotion.htm">网站推广</A></B></DIV></TD>
    <TD align=middle bgColor=#e5ecf9><B><A 
      href="http://www.rr365.net/webrestruction.htm">网站优化</A></B></TD>
    <TD align=middle bgColor=#e5ecf9>
      <DIV><B><A 
      href="http://www.rr365.net/agent/emarketing.htm">轻松代理</A></B></DIV></TD>
    <TD align=middle bgColor=#e5ecf9><B><A 
      href="http://www.rr365.net/webhosting.htm">虚拟主机</A></B></TD>
    <TD align=middle bgColor=#e5ecf9>
      <DIV><B><A 
href="http://www.rr365.net/vpp/domain.htm">域名注册</A></B></DIV></TD>
    <TD align=middle bgColor=#e5ecf9><B><A 
      href="http://www.rr365.net/webdesign.htm">网站建设</A></B></TD></TR></TBODY></TABLE>
<TABLE id=table2 width="100%">
  <TBODY>
  <TR>
    <TD bgColor=#00ccff colSpan=2 height=10> </TD></TR>
  <TR>
    <TD vAlign=top width="23%" bgColor=#e5ecf9 rowSpan=5> 
      <P><IMG height=25 src="◤CSS教程_CSS定位1--▃▄ 龙 人 网 络 ▄▃.files/logo6.gif" 
      width=25 border=0> <B><A href="http://www.rr365.net/edu-css/css.htm"><FONT 
      color=#ff0000>CSS教程</FONT></A></B></P>
      <UL style="FONT-SIZE: 10pt; LINE-HEIGHT: 13pt">
        <LI><A href="http://www.rr365.net/edu-css/css.htm">认识CSS</A> 
        <LI><A href="http://www.rr365.net/edu-css/css102.htm">语法</A> 
        <LI><A href="http://www.rr365.net/edu-css/css103.htm">伪类—动态链接</A> 
        <LI><A href="http://www.rr365.net/edu-css/css104.htm">CSS属性</A> 
        <LI><A href="http://www.rr365.net/edu-css/css105.htm">CSS定位</A> 
        <LI>
        <P style="LINE-HEIGHT: 13pt" align=left><A 
        href="http://www.rr365.net/edu-css/css106.htm">滤镜</A> </P>
        <LI>
        <P style="LINE-HEIGHT: 13pt" align=left><A 
        href="http://www.rr365.net/edu-css/css107.htm">CSS结合JS的运用</A> </P>
        <LI>
        <P style="LINE-HEIGHT: 13pt" align=left><A 
        href="http://www.rr365.net/edu-css/css108.htm">如何在网页中插入CSS</A> 
      </P></LI></UL>
      <P><IMG height=25 src="◤CSS教程_CSS定位1--▃▄ 龙 人 网 络 ▄▃.files/logo411.gif" 
      width=25 border=0> <FONT color=#000000><B><A 
      href="http://www.rr365.net/edu-css/css2.htm"><FONT 
      color=#008080>CSS技巧</FONT></A></B></FONT></P>
      <P><IMG height=25 src="◤CSS教程_CSS定位1--▃▄ 龙 人 网 络 ▄▃.files/logo411.gif" 
      width=25 border=0> <FONT color=#008080><B>CSS相关网站</B></FONT></P>
      <UL style="FONT-SIZE: 10pt; LINE-HEIGHT: 13pt">
        <LI><A href="http://www.w3.org/Style/CSS/" target=_blank>W3C之CSS规范</A> 
        <LI><A href="http://www.w3schools.com/css/default.asp" target=_blank>CSS 
        Tutorial</A> </LI></UL>
      <P><IMG height=25 src="◤CSS教程_CSS定位1--▃▄ 龙 人 网 络 ▄▃.files/logo411.gif" 
      width=25 border=0> <B><FONT color=#000000><A 
      href="http://www.rr365.net/edu-css/css4.htm"><FONT 
      color=#008080>CSS相关软件</FONT></A></FONT></B></P>
      <P> </P> </TD>
    <TD width="77%"> 
      <UL type=square>
        <LI>
        <P align=center><U><B><FONT size=4>CSS教程.CSS定位</FONT></B></U></P>
        <P align=left> </P>
        <DIV align=center>
        <TABLE id=table4 cellSpacing=0 cellPadding=0 border=0>
          <TBODY>
          <TR>
            <TD class=p2 vAlign=top>
              <P class=p2 style="LINE-HEIGHT: 17pt"><B><FONT 
              style="FONT-SIZE: 11pt" color=#336633>1.动态转换</FONT></B></P>
              <P class=p2 style="LINE-HEIGHT: 17pt"><SPAN 
              style="FONT-SIZE: 11pt">  通过在CSS中设置属性,我们可以准确的定义一个页面的样式,如颜色、字体、边框等。现在我们要讲的CSS定位主要是在页面的布局和控制上进行定义,使您的页面从这两个方面都展现的非常完美,更加富有动感。 
              <BR>  另外,在讲解之前,我们首先介绍两个定义:相对定位和绝对定位。相对定位就是允许在文档的原始位置上进行偏移。而绝对定位则允许任意定位。<BR>  实现CSS的定位最终还是要靠属性。我们来看一下定位属性的详细列表(见下图):</SPAN></P>
              <P class=p2 style="LINE-HEIGHT: 17pt" align=center><SPAN 
              style="FONT-SIZE: 11pt"><IMG height=174 alt=定位属性 
              src="◤CSS教程_CSS定位1--▃▄ 龙 人 网 络 ▄▃.files/css065.gif" width=430 
              border=0 orig_onmouseout="null" orig_onmouseover="null"> 
              </SPAN></P>
              <P class=p2 style="LINE-HEIGHT: 17pt"><SPAN 
              style="FONT-SIZE: 11pt">  我们在下面举一个例子,其中带了一点Script的内容,我们来看看它是如何实现动态显示的。<BR>  通过简单的<A 
              href="http://www.rr365.net/edu-css/css.htm"><FONT 
              color=#000000>CSS</FONT></A>定位实现了颇具动感的效果。这种效果的代码如下:</SPAN></P>
              <P class=p2 style="LINE-HEIGHT: 17pt"><SPAN 
              style="FONT-SIZE: 11pt">  <FONT 
              color=#006666>&lt;html&gt;<BR>   &lt;head&gt;<BR>   &lt;title&gt;dingwei 
              css&lt;/title&gt; <BR>   &lt;style type=“text/css”&gt; 
              <BR>   &lt;!-- <BR>    
              #container1{position:absolute;top:100}</FONT> <BR>    <FONT 
              color=#cc33cc>//*定义container1 为绝对位置*//</FONT> <BR>    <FONT 
              color=#006666>#container2{position:absolute;top:100;visibility:hidden;}</FONT><BR>    <FONT 
              color=#cc33cc>//*定义container2为绝对定位,初始可见度为hidden(隐藏)*//</FONT> 
              <BR>    <FONT color=#006666>p{font-size:12pt;}</FONT><FONT 
              color=#cc33cc>//*定义p的字体*//</FONT><BR>   <FONT color=#006666> 
              --&gt; <BR>    &lt;/style&gt; <BR>    &lt;/head&gt; <BR>    
              &lt;body&gt; <BR>    &lt;p 
              style=“font-family:行书体;font-size:15pt;color:#cc33cc”&gt;</FONT> 
              <BR>    请选择一幅图片: &lt;/p&gt;<FONT 
              color=#cc33cc>//*设置字体大小、名称、颜色*//</FONT> <BR>   <FONT 
              color=#006666> &lt;div id=“container1”&gt; <BR>    
              &lt;dd&gt;&lt;img src=“ss01065.jpg” 
              width=“185”height=“280”&gt;</FONT> <FONT 
              color=#cc33cc><BR>   //*导入一张图片,标识符为container1*// </FONT><BR>    
              <FONT color=#006666>&lt;p 
              style=“font-family:行书体;color:#cc9933;font-size:12pt”&gt;<BR>    
               名称:大漠&lt;/p&gt;</FONT><FONT 
              color=#cc33cc>//*设置字体名称、颜色、大小*//</FONT> <BR>    &lt;<FONT 
              color=#006666>/dd&gt; <BR>    &lt;/div&gt; <BR>    &lt;div 
              id=“container2”&gt;<BR>    &lt;dd&gt;&lt;img src=“ss01095.jpg” 
              width=“185”height=“280”&gt;</FONT> <FONT 
              color=#cc33cc><BR>   //*导入另一种图片,标识符为container2*//</FONT> <BR>    
              <FONT color=#006666>&lt;p 
              style=“font-family:行书体;color:#3366cc;font-size:12pt”&gt;<BR>     名称: 
              大海&lt;/p&gt; <BR>    &lt;/dd&gt; <BR>    &lt;/div&gt; <BR>    
              &lt;form name=“myform”&gt;</FONT><FONT 
              color=#cc33cc>//*定义两个按钮*//</FONT> <BR>    <FONT 
              color=#006666>&lt;p&gt;&lt;input type=“button” value=“大漠” 
                   <BR>    onclick=“container1.style.visibility=‘visible’;<BR>    container2.style.visibility=‘hidden’”&gt;</FONT> 
              <BR>    <FONT color=#cc33cc>//*定义鼠标点击事件图片1为可见,图片2为不可见*//</FONT> 
              <BR>    <FONT color=#006666>&lt;input type=“button” 
              value=“大海”;<BR>    container1.style.visibility=‘hidden’; 
              <BR>    onclick=“container2.style.visibility=‘visible’; 
              <BR>    container1.style.visibility=‘hidden’”&gt;&lt;/p&gt;</FONT> 
              <BR>    <FONT color=#cc33cc>//*定义鼠标点击事件图片1为不可见,图片2为可见*//</FONT> 
              <BR>    </SPAN><FONT color=#006666><SPAN 
              style="FONT-SIZE: 11pt">&lt;/form&gt;<BR>    &lt;/body&gt; 
              <BR>  &lt;/html&gt;</SPAN></FONT></P>
              <P class=p2 style="LINE-HEIGHT: 17pt"><SPAN 
              style="FONT-SIZE: 11pt">  代码虽然长了一些,但结构很简单,您只要用心看注释,很容易理解的。下一节我将向您继续介绍一个CSS定位的例子。 
              </SPAN></P></TD></TR></TBODY></TABLE></DIV>
        <P align=left><BR></P></LI></UL></TD></TR>
  <TR>
    <TD>
      <P 
      align=center>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
      <A href="http://www.rr365.net/edu-css/css104j.htm">上一节</A>|<A 
      href="http://www.rr365.net/edu-css/css105b.htm">下一节</A></P></TD></TR>
  <TR>
    <TD>
      <HR width="75%" color=#e5ecf9>

      <P align=center>网页教程: <A 
      href="http://www.rr365.net/edu-asp/index.htm">ASP</A>| <A 
      href="http://www.rr365.net/edu-asp-net/asp-net.htm">ASP.net</A>| <A 
      href="http://www.rr365.net/edu-xml/xml.htm">XML</A>| <A 
      href="http://www.rr365.net/edu-php/php.htm">PHP4</A> | <A 
      href="http://www.rr365.net/edu-frontpage/frontpage.htm">FrontpageXP</A> | 
      <A 
      href="http://www.rr365.net/edu-dreamweaver/dreamweaver.htm">DreamWeaverMX</A></P>
      <P 
      align=center>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
      <A href="http://www.rr365.net/edu-cplus/c.htm">C#</A>| <A 
      href="http://www.rr365.net/edu-jsp/jsp.htm">JSP</A>&nbsp;| <A 
      href="http://www.rr365.net/edu-javascript/javascript.htm">JavaScript</A> | 
      <A href="http://www.rr365.net/edu-vbscript/vbscript.htm">VBScript</A> | <A 
      href="http://www.rr365.net/edu-css/css.htm">CSS</A></P></TD></TR>
  <TR>
    <TD>
      <HR width="50%" color=#e5ecf9>

      <P> </P></TD></TR>
  <TR>
    <TD>
      <FORM name=query0 action=http://www1.baidu.com/baidu method=get 
      target=_blank>
      <DIV align=center><INPUT type=hidden value=baidu name=tn0> <A 
      href="http://www.baidu.com/"><IMG alt=Baidu 
      src="◤CSS教程_CSS定位1--▃▄ 龙 人 网 络 ▄▃.files/baidu_logo.gif" align=bottom 
      border=0></A> <INPUT size=15 name=word0> <IFRAME border=0 name=I1 
      marginWidth=0 marginHeight=0 
      src="◤CSS教程_CSS定位1--▃▄ 龙 人 网 络 ▄▃.files/help1.htm" frameBorder=no width=0 
      scrolling=no height=0></IFRAME><INPUT type=submit value=百度搜索> 
      </DIV></FORM> </TD></TR></TBODY></TABLE>
<TABLE id=table3 cellPadding=0 width="100%" border=0>
  <TBODY>
  <TR>
    <TD style="BORDER-BOTTOM: 1px solid" borderColor=#00ccff height=21> </TD></TR>
  <TR>
    <TD background="◤CSS教程_CSS定位1--▃▄ 龙 人 网 络 ▄▃.files/tdbg.gif" 
bgColor=#e5ecf9>
      <P align=center><B><A 
      href="http://www.rr365.net/summary/aboutus.htm">关于我们</A>-<A 
      href="http://www.rr365.net/summary/paymethod.htm">付款方式</A>-<A 
      href="http://www.rr365.net/helpcenter/helpcenter.htm">帮助中心</A>-<A 
      href="http://www.rr365.net/agent/agent.htm">轻松代理</A>-<A 
      href="http://www.rr365.net/sitemap.htm">网站地图</A>-<A 
      href="mailto:support@rr365.net">联系我们</A></B></P></TD></TR></TBODY></TABLE></BODY></HTML>

⌨️ 快捷键说明

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