zoukankan      html  css  js  c++  java
  • html中position两属性relative和absolute区别

    源码如下:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>image position </title>
    <style type="text/css">
    html,body{100%;height:100%;margin:0px;padding:0px;}
    div{border:solid gray 1px;}
    #one1,#one2{height:300px;500px;}
    #one1{position:relative; margin-left:10px; margin-top:10px; padding:10px 0px 0px 10px;}
    #one11{position:absolute;top:10px;left:10px;}
    </style>
    </head>
    <body onclick="javascript:alert(0);">
    <div id="one">
    <div id="one2">

    </div>
    <div id="one1">
    <img alt="MM" src="1.jpg" height="300" width="500"/>
    <div id="one11"><img alt="" src="2.jpg" width="100" height="100" /></div>
    </div>

    </div>
    </body>
    </html>

    在firefox 和 IE中测试过,有问题请给我留言。
  • 相关阅读:
    MySQL的双主配置
    MySQL主从复制配置部署
    Linux centOS安装MySQL
    hive搜索报错
    常用设计模式
    Cookie禁用 获取session
    排序算法
    MySQL优化
    javascript Map和Set
    ThinkPHP的基本操作
  • 原文地址:https://www.cnblogs.com/xinzhuangzi/p/4100573.html
Copyright © 2011-2022 走看看